/*
 * Building blocks: cards, buttons, fields, tables, tabs, alerts, dialogs.
 * No numeric values with design meaning -- everything comes from tokens.css.
 */

/* --- Card ----------------------------------------------------------- */
.card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}
.card--flat { box-shadow: none; }
.card--tight { padding: var(--space-4); }
.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
}
.card__hint {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  /* The same height as an input: a button beside a field that is two pixels
     taller looks broken in a way nobody can name. Padding alone did not settle
     it -- the font inside a button and the one inside a field are not the same
     size -- so both sit on the same floor. */
  min-height: var(--control-height);
  padding: var(--control-pad-y) var(--space-4);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration) var(--easing), border-color var(--duration) var(--easing);
}
.btn:hover:not(:disabled) { background: var(--surface-muted); border-color: var(--fg-subtle); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* A button that is working (17.09.2026): a turning ring beside a label that says
   what it is doing. The ring is drawn from the button's own colour, so it fits
   every kind of button without a colour of its own. */
.btn[aria-busy="true"] { cursor: progress; }
.btn__spin {
  flex: 0 0 auto;
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
/* Standing still it is still a mark that something is going on, and the label
   says the same in words. */
@media (prefers-reduced-motion: reduce) {
  .btn__spin { animation: none; }
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.btn--primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn--danger { color: var(--danger); border-color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger-subtle); }

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--fg-muted);
  padding: var(--space-1) var(--space-2);
}
.btn--ghost:hover:not(:disabled) { background: var(--surface-muted); color: var(--fg); }

/* The small one is the exception, and on purpose: it sits INSIDE a table row,
   and a row action as tall as a full button would push every row apart. */
.btn--sm {
  min-height: 0;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-on-sidebar-muted);
  cursor: pointer;
  transition: background var(--duration) var(--easing), color var(--duration) var(--easing);
}
.icon-btn:hover { background: var(--sidebar-hover); color: var(--fg-on-sidebar); }

.icon {
  width: var(--space-5);
  height: var(--space-5);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--stroke-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: var(--space-4); height: var(--space-4); }

/* --- Fields ---------------------------------------------------------- */
/* Rows from the top. In a grid row the fields are stretched to the tallest one,
   and without this the stretch went into the rows of the shorter field: a select
   next to a field with a two-line hint came out taller than its neighbour
   (Provisionierung, 17.09.2026). */
.field { display: grid; gap: var(--space-1); align-content: start; }
.field__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
}
.field__input {
  width: 100%;
  /* The same floor as the switch and the buttons. Without it, text box, select,
     number box and password field each end up a different height, and a row of
     settings looks broken in a way nobody can name. */
  min-height: var(--control-height);
  padding: var(--control-pad-y) var(--space-3);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg);
  transition: border-color var(--duration) var(--easing);
}
.field__input:hover:not(:disabled) { border-color: var(--fg-subtle); }
.field__input:disabled { background: var(--surface-muted); color: var(--fg-subtle); }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__hint { font-size: var(--text-xs); color: var(--fg-subtle); }
.field__error { font-size: var(--text-xs); color: var(--danger); }

.field__input--area {
  height: auto;
  font-family: var(--font-mono);
  line-height: var(--leading-normal);
  resize: vertical;
  /* A text area is the one control that wants the room it is given. */
  max-width: none;
}

/*
 * A control is as wide as what goes INTO it, not as wide as the box around it
 * (0.58.0, asked for as a rule so it need not be decided again per dialog).
 *
 * A field stretched across a whole modal says nothing about what belongs in
 * it, and a row of them reads as a wall. So: a select takes the width of its
 * longest option, a number or a time takes the few characters it holds, and
 * ordinary text stops at the width of a name or an address. Where a field
 * really needs the room -- a text area, or one marked as wide -- it says so.
 */
.field__input { max-width: 34rem; }
/* A select fits its longest option -- but the cap above still holds: a
   directory of four hundred contacts has one entry with a very long name, and
   "max-width: 100%" here quietly lifted the limit for every select in the
   interface (19.09.2026). */
select.field__input { width: auto; max-width: min(100%, 34rem); }
input[type="number"].field__input { width: auto; max-width: 12rem; }
input[type="time"].field__input,
input[type="date"].field__input,
input[type="color"].field__input { width: auto; }
/* The same safety for the two smaller ones: "auto" is the browser's own idea
   of how wide its date control is, and a theme with a larger font makes that
   idea too small (0.70.1). */
input[type="date"].field__input { min-width: 10rem; }
input[type="time"].field__input { min-width: 7rem; }
/*
 * A date AND a time in one control (0.70.0, asked for).
 *
 * "width: auto" is right for a bare time or date; for datetime-local it is
 * not -- the browser draws day, month, year, hour and minute in it and cuts
 * the last of them off in every theme with a slightly larger font. Enough
 * room for all five, and no more than the field it stands in.
 */
input[type="datetime-local"].field__input {
  width: auto;
  min-width: 15rem;
  max-width: 100%;
}

/* How wide a control should be, by what goes into it (0.70.0). Named rather
   than measured: the caller's number, a handful of keys, a point in time. */
.field--w-number .field__input { width: auto; max-width: 14rem; }
.field--w-short .field__input { width: auto; max-width: 9rem; }
.field--w-stamp .field__input { width: auto; max-width: 16rem; }
/*
 * NOT here: "wide" says the field spans both columns of the grid, not that
 * the control inside it may grow without end. Everything handed to a dialog
 * as `content` -- the contact field with its directory and its number, for
 * one -- is marked wide, and lifting the cap here made exactly those two
 * stretch across the window again (19.09.2026). The text area lifts it for
 * itself, above.
 */

.field-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
/* One below the other. For a short page of settings that is read down rather
   than filled in field by field. A field the width of the screen says nothing
   about how much belongs in it; 48 characters is what a name, a place or an
   address needs. */
.field-grid--stacked { grid-template-columns: minmax(0, 1fr); }
.field-grid--narrow .field,
.field-grid--narrow .field__input { max-width: 48ch; }

/* --- Yes/no as a switch ---------------------------------------------------
   Still a real <input type="checkbox">, only hidden behind the track and the
   knob: the keyboard, the label and a screen reader all keep working, and
   :checked does the drawing. A rebuilt slider out of divs would have to earn
   every one of those back. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  /* The anchor of the hidden box below (0.114.1). Without it the box sat at the
     top of the dialog, a click on the switch focused it there, and the browser
     scrolled the list up to it: "wenn ich die ereignisliste nach unten gescrollt
     habe und einen toggle aktiviere, springt die ganze seite im modal nach oben". */
  position: relative;
}
.switch__box {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  transition: background var(--duration) var(--easing);
}
.switch__knob {
  position: absolute;
  top: var(--switch-inset);
  left: var(--switch-inset);
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration) var(--easing);
}
.switch__box:checked + .switch__track { background: var(--accent); }
.switch__box:checked + .switch__track .switch__knob { transform: translateX(1.1rem); }
.switch__box:focus-visible + .switch__track { box-shadow: var(--focus-ring); }
.switch__box:disabled + .switch__track { opacity: 0.5; }
.switch__box:disabled ~ .switch__label { color: var(--fg-subtle); }
/* The name on the LEFT of an inline switch (0.97.1). With the state on the right,
   the row keeps its height whatever the state says -- and which side of a track
   means "on" needs no guessing. */
.switch__label { white-space: nowrap; }
.switch__state {
  user-select: none;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}
/* Same vertical rhythm as an input: title, control, hint. */
.field--switch .switch { min-height: var(--control-height); }
/*
 * Name, switch and state in ONE line, set off from what is above it.
 *
 * For a single switch that belongs to the card rather than to a form -- "Nicht
 * stören" under the reachability (0.58.0). Stacked, it read as a fourth
 * setting in the list above and looked like a form that had lost its save
 * button; in a line of its own it is what it is: one thing one flips.
 */
.field--sideways {
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  column-gap: var(--space-3);
  margin-block-start: var(--space-4);
}
.field--sideways > .field__hint,
.field--sideways > .field__error { grid-column: 1 / -1; }

/* A switch on its own in a row of buttons: the label beside it, one control tall. */
.switch--inline { min-height: var(--control-height); }
/* Two inline switches in a row: the label of one must not run into the next. */
.switch--inline + .switch--inline { margin-inline-start: var(--space-3); }
.switch--inline .switch__state { color: var(--fg); }

.toggle { display: flex; align-items: center; gap: var(--space-2); }
.toggle input { width: var(--space-4); height: var(--space-4); accent-color: var(--accent); }

/* --- Tabs ---------------------------------------------------------- */
/* The tabs are links with an href to a route, not buttons holding JavaScript
   state. Only that way does the selected tab survive a browser reload, and only
   that way can the page be linked to. */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: var(--border-width) solid var(--border);
  overflow-x: auto;
}
.tabs__link {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-bottom: var(--border-width-accent) solid transparent;
  background: transparent;
  color: var(--fg-muted);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.tabs__link:hover { color: var(--fg); }
.tabs__link[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Table --------------------------------------------------------- */
.table-frame {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td {
  padding: var(--space-2) var(--space-4);
  text-align: left;
  border-bottom: var(--border-width) solid var(--border);
  height: var(--table-row-height);
}
.table thead th {
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-muted); }
.table__number { text-align: right; font-family: var(--font-mono); }
.table__actions { text-align: right; white-space: nowrap; }

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--border);
  flex-wrap: wrap;
}
.search { min-width: 12rem; max-width: 20rem; }

.empty {
  padding: var(--space-10) var(--space-5);
  text-align: center;
  color: var(--fg-muted);
}
.empty__title { font-weight: var(--weight-medium); color: var(--fg); margin-bottom: var(--space-1); }

/* --- Badges and status dots ----------------------------------------------- */
/* A state is what one scans a list for. Filled and saturated, it is read at a
   glance; as a pale tint it took a second look. Every pairing is calculated --
   the lowest is 4,95:1, most are above 7. */
/* Listening to a standard announcement, in the row it belongs to (0.78.0):
   the player only appears once something has been played, so the column stays
   a column instead of twenty controls one never touches. */
.prompt-listen { display: inline-flex; align-items: center; gap: var(--space-2); }
.prompt-player { max-width: 14rem; height: 2rem; }
.prompt-player:not([src]) { display: none; }

/* Several marks in one table cell: they wrap rather than widen the column. */
.row-marks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: calc(var(--space-1) / 2) var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  /* One line, always. A badge broken over two lines ("Passwort / angezeigt")
     reads as two badges and pushes the row apart. The column gets wider
     instead, which is what a table column is for. */
  white-space: nowrap;
  /* The neutral one stays quiet on purpose: "nothing special here" should not
     shout as loudly as "no password". */
  background: var(--surface-muted);
  color: var(--fg-muted);
  border: var(--border-width) solid var(--border);
}
.badge--success {
  background: var(--badge-success);
  color: var(--badge-success-fg);
  border-color: var(--badge-success);
}
.badge--warning {
  background: var(--badge-warning);
  color: var(--badge-warning-fg);
  border-color: var(--badge-warning);
}
.badge--danger {
  background: var(--badge-danger);
  color: var(--badge-danger-fg);
  border-color: var(--badge-danger);
}
.badge--accent {
  background: var(--badge-accent);
  color: var(--badge-accent-fg);
  border-color: var(--badge-accent);
}

/* Dot AND text: colour alone distinguishes nothing for a colour-blind reader. */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}
.status-dot::before {
  content: "";
  width: var(--space-2);
  height: var(--space-2);
  border-radius: 50%;
  background: var(--fg-subtle);
  flex: 0 0 auto;
}
/* The badge green, not the text green. A dot carries no text, so it may be the
   bright one -- and "verbunden" in the status bar and an "Aktiv" chip in a list
   say the same thing and should look it. */
.status-dot--success::before { background: var(--badge-success); }
.status-dot--warning::before { background: var(--warning); }
.status-dot--danger::before { background: var(--danger); }

/* Two steps up from the smallest size, on request: a monospaced digit is
   narrower than a proportional one, so at --text-xs a number was the smallest
   thing on the screen -- and numbers are what one reads here most carefully.
   Now at the base size, i.e. level with the text around it. */
.mono { font-family: var(--font-mono); font-size: var(--text-md); }
/* A checksum has no spaces to break at, and on a narrow screen it would push
   the page sideways. */
.mono--break { overflow-wrap: anywhere; }

/* --- Alerts ------------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: var(--border-width) solid transparent;
  font-size: var(--text-sm);
}
.alert--danger { background: var(--danger-subtle); border-color: var(--danger); color: var(--danger); }
/* Der Text bleibt Text. Rand und Fläche signalisieren; eine Warnfarbe, die auch
   als Textfarbe tragen muss, lässt sich nur dunkel wählen -- und dunkles Orange
   ist Braun. 13,6:1 statt 4,5:1 nebenbei. */
.alert--warning { background: var(--warning-subtle); border-color: var(--warning); color: var(--fg); }
.alert--success { background: var(--success-subtle); border-color: var(--success); color: var(--success); }
.alert--info { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }

/* A sign in front of every notice that warns or informs (1.2.3, asked for: a
   small exclamation sign left of the text in every notice): a triangle in the
   sign colour with a dark mark for a warning, a circle with "!" in the danger
   colour for an error, a circle with "i" for information. A success says so by
   its colour and needs none. Masks, so the colour stays a token; the triangle
   and its mark are two layers because one mask has one colour. */
.alert--warning,
.alert--danger,
.alert--info {
  position: relative;
  padding-left: calc(var(--space-4) + var(--space-5) + var(--space-2));
}
.alert--warning::before,
.alert--warning::after,
.alert--danger::before,
.alert--info::before {
  content: "";
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  width: var(--space-5);
  height: var(--space-5);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.alert--warning::before {
  background: var(--sign-warning);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2 23.2 21.6H.8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2 23.2 21.6H.8z'/%3E%3C/svg%3E");
}
.alert--warning::after {
  background: var(--sign-warning-mark);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.9 8.6h2.2v6.6h-2.2zM10.9 16.8h2.2v2.2h-2.2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.9 8.6h2.2v6.6h-2.2zM10.9 16.8h2.2v2.2h-2.2z'/%3E%3C/svg%3E");
}
.alert--danger::before {
  background: var(--danger);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5a10.5 10.5 0 1 0 0 21 10.5 10.5 0 1 0 0-21zM10.9 6h2.2v8.2h-2.2zM10.9 15.9h2.2v2.3h-2.2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5a10.5 10.5 0 1 0 0 21 10.5 10.5 0 1 0 0-21zM10.9 6h2.2v8.2h-2.2zM10.9 15.9h2.2v2.3h-2.2z'/%3E%3C/svg%3E");
}
.alert--info::before {
  background: var(--accent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5a10.5 10.5 0 1 0 0 21 10.5 10.5 0 1 0 0-21zM10.9 9.8h2.2v8.2h-2.2zM10.9 5.8h2.2v2.3h-2.2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 1.5a10.5 10.5 0 1 0 0 21 10.5 10.5 0 1 0 0-21zM10.9 9.8h2.2v8.2h-2.2zM10.9 5.8h2.2v2.3h-2.2z'/%3E%3C/svg%3E");
}

/* The connection to Home Assistant (0.108.0): the line, and "Neu prüfen" beside
   it -- below it on a narrow screen. */
.ha-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ha-status .alert { flex: 1 1 20rem; margin: 0; }

/* --- Dialog ---------------------------------------------------------- */
.dialog {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-float);
  padding: 0;
  /* Wide enough for two columns of fields, and no wider: a form that runs the
     full width of a large screen is harder to read, not easier. */
  width: min(46rem, calc(100vw - var(--space-8)));
  max-height: calc(100vh - var(--space-12));
}
/* A question is one sentence and two buttons -- it does not need the width of a
   settings form. */
.dialog--ask { width: min(26rem, calc(100vw - var(--space-8))); }
/* The box that says something is running: as narrow as the question box, and
   with no foot, because there is nothing to answer (0.74.0, asked for). */
.dialog--working { width: min(26rem, calc(100vw - var(--space-8))); }
.progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.progress__bar {
  width: 40%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  animation: progress-slide 1.3s ease-in-out infinite;
}
@keyframes progress-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}
/* Whoever has asked for less movement gets a bar that simply stands there. */
@media (prefers-reduced-motion: reduce) {
  .progress__bar { width: 100%; animation: none; opacity: 0.7; }
}
.dialog::backdrop { background: var(--overlay); }
.dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - var(--space-12));
}
/* The switch that says whether a record is in service sits in the head, right of
   the title: it is the state of the whole thing, the same question in every
   dialog, and in the middle of a form it pushed the actual fields down. */
.dialog__active {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
}
.dialog__active .field__name { order: 2; }
.dialog__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* A dialog may carry a picture in front of its title (0.70.0): it sits with
   the title, not with what stands at the other end of the head. */
.dialog__title-wrap { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dialog__title-icon { width: 1.25rem; height: 1.25rem; flex: none; color: var(--fg-subtle); }

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid var(--border);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}
.dialog__body {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-4);
  /* A long form scrolls inside the dialog; head and foot stay put, so the save
     button never wanders off the bottom of the screen. */
  overflow-y: auto;
}
/* What was searched for, where it stands in the chapter. A background rather than
   a colour on the text: the text keeps its own contrast in both themes. */
.doc__hit {
  background: var(--accent-subtle);
  color: inherit;
  border-radius: var(--radius-sm);
  padding-inline: var(--space-1);
}
/* Every place the word stands (1.5.0): a list to choose from, between the
   search and the chapter. It scrolls by itself, so the chapter under it stays
   in reach however many places there are. */
.doc__results:empty { display: none; }
.doc__found { display: grid; gap: var(--space-2); }
.doc__places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
  max-height: 40vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.doc__place {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.doc__place:hover,
.doc__place:focus-visible { background: var(--surface-muted); }
.doc__where { font-size: var(--text-sm); color: var(--fg-muted); }
/* The place that was chosen from that list, among all the marked ones. */
.doc__here { outline: 2px solid var(--accent); outline-offset: var(--space-1); border-radius: var(--radius-sm); }

/* One event per row: the tick, and how loud it is here. */
.checks__row--level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.checks__label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.checks__level { flex: 0 0 9rem; }

/* --- The bell in the status bar ------------------------------------------
   A button with a count on it, and a panel that hangs under it. Positioned
   relative to its holder rather than floating: the status bar is the anchor, and
   a panel that follows the page when it scrolls is a panel that ends up over the
   content it is about. */
.bell { position: relative; display: inline-flex; }
.bell__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.bell__button:hover { background: var(--surface-muted); color: var(--fg); }
/* The loudest thing waiting decides the colour. A warning among ten notices has
   to look like a warning -- otherwise the levels are decoration. */
.bell__button--info { color: var(--accent); }
.bell__button--warning { color: var(--warning); }
.bell__button--danger { color: var(--danger); }
.bell__count {
  min-width: var(--space-4);
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--text-xs);
  line-height: var(--space-4);
  text-align: center;
}
.bell__panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 20;
  width: 26rem;
  max-width: 90vw;
  max-height: 24rem;
  overflow-y: auto;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.bell__count--warning { background: var(--warning); color: var(--badge-warning-fg); }
.bell__count--danger { background: var(--danger); color: var(--badge-danger-fg); }
.bell__head { font-weight: var(--weight-bold); }
.bell__entry {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}
/* The edge says how loud one message is. Everything in the panel is unread --
   what has been acknowledged is gone from here. */
.bell__entry--info { box-shadow: inset var(--border-width-marker) 0 0 var(--accent); }
.bell__entry--warning { box-shadow: inset var(--border-width-marker) 0 0 var(--warning); }
.bell__entry--danger { box-shadow: inset var(--border-width-marker) 0 0 var(--danger); }
.bell__entry-title {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  justify-content: space-between;
  font-weight: var(--weight-medium);
}

/* The first rows of a file, in the import dialog. Scrolls sideways rather than
   widening the dialog: a file with twelve columns is an ordinary file. */
.preview__scroll {
  overflow-x: auto;
  max-height: 14rem;
  overflow-y: auto;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
}
.preview {
  font-size: var(--text-sm);
  white-space: nowrap;
}

/* A folded answer: the command stays visible, the eighty lines behind it do not.
   <details> is the browser's own, so this needs no script and works without JS. */
.fold {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
}
.fold__summary {
  cursor: pointer;
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  justify-content: space-between;
}
.fold[open] .fold__summary {
  margin-bottom: var(--space-2);
}

/* Why a save was refused. Sticky, because the reason has to stay readable while
   one scrolls back to the field it is about. */
.dialog__complaint {
  position: sticky;
  top: 0;
  z-index: 1;
}
.dialog__foot {
  padding: var(--space-4) var(--space-5);
  border-top: var(--border-width) solid var(--border);
  display: flex;
  /* Record actions on the left, cancel and save on the right. Delete is not next
     to save. */
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --- Opening hours, entered rather than typed -----------------------------
   Seven day boxes and two time fields per window. Nothing to spell, so nothing
   to spell wrongly -- and the row wraps rather than pushing the dialog wide. */
/* The settings of a tenant in two columns: what it IS on the left, whom to call
   on the right. One column as soon as there is no room for two -- the fields
   then come in the order they are written. */
.settings-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
  gap: var(--space-4) var(--space-8);
  align-items: start;
}

/* A row of buttons inside a form: the worked examples of the LDAP page, the
   "record again / another file" of an announcement (28.09.2026). Side by side,
   wrapping where the column is narrow. */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Three cards of "Mein Telefon" in one row (0.52.0): what this telephone is,
   the way to the dialling page, and where calls go when nobody answers. They
   are read together; one below the other they made a page one scrolls past.
   Falls back to fewer per row as soon as there is no space. */
.self-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--space-4);
  align-items: start;
}
/* Whether this browser trusts voip.ui's authority (1.2.5, on its own page): the
   badge and the sentence beside it. */
.authority__state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }

/* One CardDAV account (1.7.2): the name with its marks in the corner, two
   columns under it -- which account, how its last run went --, the address
   books as a table, the buttons at the foot. */
.connector { display: grid; gap: var(--space-3); }
.connector__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.connector__head .card__title { margin: 0; }
.connector__chips { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.connector__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 48rem) {
  .connector__columns { grid-template-columns: minmax(0, 1fr); }
}
.connector__default { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.connector__cell-default { width: 40%; }
.connector__cell-sync { width: 1%; text-align: center; }
.connector__cell-count { text-align: right; }

/* How to install it, per device (1.5.0): the row of systems, the numbered
   steps of the chosen one, and the note for Firefox under them. */
.guide { display: grid; gap: var(--space-3); }
.guide > p { margin: 0; }
.guide__systems { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.guide__steps { display: grid; gap: var(--space-3); }
.guide__list { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }

/* Which of one's telephones the page is about (1.1.0): one button each, the
   one shown pressed. Only where there are several. */
.self-seats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* The left column of that row (1.0.0): "Meine Nebenstelle" with "Fax senden"
   under it. */
.self-stack { display: grid; gap: var(--space-4); align-content: start; }

/* One of one's own faxes on the self-service page (0.92.0): number, pages, state
   and, where there is one, the reason. A row rather than a table -- five entries
   do not need a header, and the card is narrow. */
.self-fax__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  margin: 0;
}

/* The mark of a tenant, in a colour that comes from the database rather than
   from this file: --tenant-color is set on the element. Everything else about
   it -- shape, size, what it looks like when there is no colour -- stays here. */
.tenant-dot {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--border-strong);
  background: var(--tenant-color, transparent);
  flex: 0 0 auto;
  vertical-align: -0.1em;
}
/* Unmarked: an outline, so the place where the mark would be stays visible and
   the row does not jump when one is chosen. */
.tenant-dot--none { background: transparent; }

/* In the status bar it is a stripe the full height of the bar, flush against
   the left edge: which installation one is working in should be visible from
   across the room, not read. */
.tenant-dot--bar {
  width: var(--space-3);
  height: var(--statusbar-height);
  border-radius: 0;
  border: none;
  margin-left: calc(var(--space-5) * -1);
}
.tenant-dot--bar.tenant-dot--none { border-right: var(--border-width) solid var(--border); }

/* In the picker the mark sits in front of the dropdown, because a <select>
   cannot be relied on to draw anything but text inside its own list. */
.picker__mark { display: inline-flex; align-items: center; gap: var(--space-2); }

/* The colour field: the picker itself, and a way to have no colour at all. */
.field__colour { display: flex; align-items: center; gap: var(--space-2); }
.field__colour-input {
  width: 3rem;
  height: 2rem;
  padding: 0;
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.field--no-colour .field__colour-input { opacity: 0.35; }

/* The figures at the top of the live view: the five numbers one glances at
   before reading anything. They wrap rather than shrink -- a number one has to
   lean in for is not a number one glances at. */
.live-figures {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.live-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 8rem;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.live-figure__value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.live-figure__label { font-size: var(--text-xs); color: var(--fg-muted); }

/* The two dropdowns above the call list. They sit in a row and wrap at phone
   width like every other row of fields. */
/* How much of the call list is loaded, and the way to load more (0.93.0). The
   two filters that stood here went: "Richtung" is what the column filter does,
   and "Zeitraum" was never a filter -- it is the window that is fetched. */
.calls__window {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: baseline;
  margin: 0;
}

/* --- The manual ----------------------------------------------------------
   Chapters on the left, the text on the right, and at phone width one under the
   other. The text column is capped: a line of prose wider than about ninety
   characters is one the eye loses its way in. */
.doc { display: grid; gap: var(--space-4); }
.doc__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.doc__search { flex: 0 1 22rem; }
.doc__columns {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 860px) {
  .doc__columns { grid-template-columns: minmax(0, 1fr); }
}
.doc__chapters { display: grid; gap: var(--space-1); position: sticky; top: var(--space-4); }
.doc__chapter {
  text-align: left;
  padding: var(--space-2);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font: inherit;
}
.doc__chapter:hover { background: var(--surface-muted); color: var(--fg); }
.doc__chapter--open {
  background: var(--surface-muted);
  color: var(--fg);
  font-weight: var(--weight-medium);
  border-color: var(--border);
}
.doc__text { max-width: 90ch; display: grid; gap: var(--space-3); }
.doc__title { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.doc__heading { font-size: var(--text-lg); font-weight: var(--weight-bold); margin-top: var(--space-3); scroll-margin-top: var(--space-4); }
/* A part of a sub-chapter (1.3.0): one level below it. */
.doc__subheading { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--fg-muted); }
/* The sub-chapters of the open chapter, in the list beside the text (1.3.0):
   indented under it, quieter than a chapter. */
.doc__section {
  text-align: left;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  cursor: pointer;
}
.doc__section:hover { background: var(--surface-muted); color: var(--fg); }
/* Questions and answers (1.3.0): groups of folded questions. */
.faq { display: grid; gap: var(--space-5); }
.faq__group { display: grid; gap: var(--space-1); }
.faq__question { font-weight: var(--weight-bold); }
.faq__answer { padding: var(--space-2) 0 var(--space-3) var(--space-5); }
.doc__list { padding-left: var(--space-5); list-style: disc; display: grid; gap: var(--space-1); }
ol.doc__list { list-style: decimal; }
.doc__code {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
}
.doc__table { overflow-x: auto; }
.doc__grid { border-collapse: collapse; width: 100%; }
.doc__grid th, .doc__grid td {
  text-align: left;
  padding: var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
  vertical-align: top;
}

/* The figures on the security page use the live-view tiles, coloured by what
   they count: nobody should have to read the caption to see that something is
   urgent. */
.live-figure--danger { border-color: var(--danger); }
.live-figure--warning { border-color: var(--warning); }

/* One finding: what it is about, and the objects it names. */
.finding__level { margin-bottom: var(--space-2); }
.finding__objects { font-size: var(--text-xs); color: var(--fg-muted); overflow-wrap: anywhere; }

/* A difference between two revisions. One line per object, one per field --
   read down the page, so the field names line up under each other. */
.diff-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.diff-field {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-left: var(--space-6);
  font-size: var(--text-sm);
}
.diff-field__before { color: var(--fg-muted); text-decoration: line-through; }
.diff-field__after { color: var(--fg); font-weight: var(--weight-medium); }

/* One voicemail message: who called, the player, and the way to get rid of it. */
.message-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
/* The words of a message, under who left it (0.116.0). */
.message-row__text {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--fg);
  white-space: pre-wrap;
  font-style: italic;
}
.message-row .player { flex: 1 1 18rem; width: auto; }

/* A list to tick off: which extensions may use a route. Scrolls rather than
   growing without end -- sixty extensions are a list, not a form. */
.checks {
  display: grid;
  gap: var(--space-1);
  max-height: 14rem;
  overflow-y: auto;
  padding: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.checks__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.checks__row:hover { background: var(--surface-muted); }
.checks__box { accent-color: var(--accent); }

/* A picked list whose order is the data: the trunks of an outbound route. The
   number in front is the order they are tried in, which is what the whole widget
   exists to make visible. */
.picks { display: grid; gap: var(--space-1); counter-reset: pick; }
.pick {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.pick::before {
  counter-increment: pick;
  content: counter(pick) ".";
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}
.pick__name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.pick__actions { display: flex; gap: var(--space-1); }
.pick__add { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pick__add .field__input { flex: 0 1 22rem; }
/* The penalty of a queue agent: a number between 0 and 99, and a box the width of
   a number rather than of the row. */
.pick__penalty { flex: 0 0 5rem; }

.window-row,
.holiday-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
}
.window-row__times { display: flex; align-items: end; gap: var(--space-2); }
.daypick { display: flex; flex-wrap: wrap; gap: var(--space-1); align-self: center; }
.daypick__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: var(--control-pad-y) var(--space-2);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
}
/* The box itself is not shown -- the label IS the button. It stays a real
   checkbox, so the keyboard and a screen reader keep working. */
.daypick__box { position: absolute; opacity: 0; width: 0; height: 0; }
.daypick__box:checked + span { font-weight: var(--weight-bold); }
.daypick__day:has(.daypick__box:checked) {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}
.daypick__day:has(.daypick__box:focus-visible) { outline: var(--border-width-marker) solid var(--accent); }

/* --- Announcements -------------------------------------------------------- */
/* The player and the curve belong together and are read as one thing, so they
   sit in one block with almost no air between them -- the grid gap of a dialog
   section would put a finger's width in the middle of it. */
.player-block { display: grid; gap: var(--space-1); }
.player {
  display: block;
  width: 100%;
  /* The browser's own height for an <audio> element leaves air above and below
     the control bar it draws. The bar itself scales to the box, so the box is
     set to the height of the bar. */
  height: var(--player-height);
}
/* The level of a recording over time. The colours come from the tokens so the
   picture follows the display mode like everything else. */
/* Over a cut mark: the line is one pixel wide and nothing else on the page is
   draggable, so the pointer has to say so. */
.waveform--grab { cursor: ew-resize; }
.waveform {
  width: 100%;
  height: 7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  --waveform-ink: var(--accent);
  --waveform-muted: var(--border-strong);
  --waveform-line: var(--border);
  --waveform-mark: var(--danger);
  --waveform-head: var(--success);
  --waveform-head-text: var(--badge-success-fg);
  --waveform-text: var(--fg-subtle);
  --waveform-grid: var(--border);
}

.recorder__time {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.recorder__buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --- Backend not reachable ------------------------------------------------
   Covers everything. A form one can go on filling in while nothing can be saved
   is a trap: the work goes into fields that never reach anywhere, and the
   failure only shows up at the end, on Save. */
.offline {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--overlay);
}
.offline__box {
  max-width: 34rem;
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-left: var(--border-width-marker) solid var(--danger);
  box-shadow: var(--shadow-float);
}
.offline__title { font-size: var(--text-lg); font-weight: var(--weight-bold); }
.offline__text { color: var(--fg-muted); }
.offline__next {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}

/* --- Toasts --------------------------------------------------- */
/* Top centre. At the bottom right of a wide screen the message sits nowhere near
   what one is looking at while saving -- and that is where a failed save gets
   missed. The strip itself lets clicks through; only the toasts catch them, so
   nothing under the top bar becomes unreachable. */
/* Centred, but BELOW the status bar (17.09.2026): a message that covers the bar
   covers the installation one is in, the clock and the quick access -- and the
   quick access is exactly what one reaches for after a message says something
   was saved. On a narrow screen the bar sits under the folded menu, where no
   fixed offset can follow it; there the quick access is hidden anyway. */
.toasts {
  position: fixed;
  top: calc(var(--statusbar-height) + var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  z-index: 40;
  width: max-content;
  max-width: min(40rem, 92vw);
  pointer-events: none;
}
.toast {
  /* Flex with a gap: the message and the dismiss button ran into each other
     ("input not validVerstanden"). */
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-left: var(--border-width-marker) solid var(--accent);
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm);
  pointer-events: auto;
}
.toast > span {
  /* A long message wraps instead of pushing the button off the box. */
  min-width: 0;
}
.toast--danger { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }

/* --- Stats ------------------------------------------------------ */
.stats {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.stat { display: grid; gap: var(--space-1); }
.stat__name {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
}
.stat__value { font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: var(--leading-tight); }

/* The text area copyText() copies through where the clipboard API is missing
   (plain HTTP). In the page, because execCommand only copies what is in it --
   but nowhere one could see or click it. */
.copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

/* The jump search, Alt+E (0.102.0): a field and the places that match, the
   one Enter would take marked. */
.dialog--jump { width: min(34rem, calc(100vw - 2 * var(--space-4))); }
.jump__input { width: 100%; }
.jump__list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}
.jump__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.jump__item:hover { background: var(--surface-muted); }
.jump__item--at { background: var(--accent-subtle); }
.jump__name { font-weight: var(--weight-medium); }
.jump__where { font-size: var(--text-sm); color: var(--fg-muted); text-align: right; }
.jump__none { padding: var(--space-2) var(--space-3); color: var(--fg-muted); }

/* --- Definition list --------------------------------------------- */
.definition-list { display: grid; gap: var(--space-3); }
.definition-list__row {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: var(--space-4);
  align-items: baseline;
}
.definition-list__name { font-size: var(--text-sm); color: var(--fg-muted); }
.definition-list__name--lead { display: inline-flex; align-items: center; gap: var(--space-2); }
@media (max-width: 40rem) {
  .definition-list__row { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* --- Section: a titled block without a tile around it ---------------------
   Tables live in one of these. A list inside a card means a frame within a
   frame, and on a narrow screen the two borders eat the width the data needs. */
.section { display: grid; gap: var(--space-3); }
/* A column of blocks with air between them. For a part of a page that is built
   and rebuilt from script -- the result of a certificate check, say. */
.stack { display: grid; gap: var(--space-3); }

/* A numbered instruction that leaves this interface -- setting up an app on a
   telephone, where nothing here can help any further. */
.steps {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}
.section__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.section__hint { font-size: var(--text-sm); color: var(--fg-muted); max-width: 70ch; }
.section__title + .section__hint { margin-top: calc(var(--space-2) * -1); }

/* --- Data table ----------------------------------------------------------- */
.dt { display: grid; gap: var(--space-3); }

.dt__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.dt__bar-left,
.dt__bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
/* Holders the table redraws in place while one types; they add no box of their own. */
.dt__status,
.dt__content { display: contents; }
/* A line between the blocks a list is ordered in. */
.dt__group td {
  padding-block: var(--space-2) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--surface-muted);
  border-block-start: var(--border-width) solid var(--border);
}

.dt__search { position: relative; display: flex; align-items: center; }
.dt__search-icon {
  position: absolute;
  left: var(--space-2);
  color: var(--fg-subtle);
  pointer-events: none;
}
.dt__search-input {
  width: 16rem;
  max-width: 100%;
  /* The same height as every other control -- see --control-pad-y. The wide
     horizontal padding stays: it is what leaves room for the magnifier on the
     left and the clear button on the right. */
  padding: var(--control-pad-y) var(--space-8);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg);
}
.dt__search-input::-webkit-search-cancel-button { appearance: none; }
.dt__search-clear {
  position: absolute;
  right: var(--space-1);
  display: inline-flex;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-subtle);
  cursor: pointer;
}
.dt__search-clear:hover { color: var(--fg); background: var(--surface-muted); }

.dt__count { font-size: var(--text-xs); color: var(--fg-subtle); white-space: nowrap; }

.dt__size-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--fg-muted);
  white-space: nowrap;
}
.dt__size {
  padding: var(--control-pad-y) var(--space-2);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-sm);
}

.dt__icon-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  /* Same height again: the toolbar is one row, and a button half a millimetre
     taller than the field beside it makes the whole row look crooked. */
  padding: var(--control-pad-y) var(--space-3);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--fg-muted);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.dt__icon-button:hover:not(:disabled) { color: var(--fg); border-color: var(--fg-subtle); }
.dt__icon-button:disabled { opacity: 0.5; cursor: default; }
.dt__icon-button--active { color: var(--accent); border-color: var(--accent); }

.dt__pages { display: inline-flex; align-items: center; gap: var(--space-1); }
.dt__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}
.dt__page:hover { background: var(--surface-muted); color: var(--fg); }
.dt__page--current {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: var(--weight-bold);
}
.dt__page--disabled { opacity: 0.35; pointer-events: none; }

.dt__scroll { overflow-x: auto; }
.dt__table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.dt__table th,
.dt__table td {
  text-align: left;
  border-bottom: var(--border-width) solid var(--border);
  height: var(--table-row-height);
  padding: var(--space-2) var(--space-3);
}
.dt__table thead th {
  position: relative;
  background: var(--surface-muted);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
  white-space: nowrap;
  user-select: none;
}
.dt__table tbody tr:hover { background: var(--surface-muted); }
.dt__table tbody tr[role="button"] { cursor: pointer; }
.dt__table tbody tr[role="button"]:focus-visible {
  box-shadow: var(--focus-ring) inset;
}
.dt__number { text-align: right; font-family: var(--font-mono); }
.dt__actions { text-align: right; white-space: nowrap; }

.dt__head { display: flex; align-items: center; gap: var(--space-1); }
.dt__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.dt__sort:hover { color: var(--fg); }
.dt__sort--active { color: var(--accent); }
.dt__sort .icon { opacity: 0.4; }
.dt__sort--active .icon { opacity: 1; }

.dt__filter-wrap { position: relative; display: inline-flex; }
.dt__filter {
  display: inline-flex;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-subtle);
  cursor: pointer;
}
.dt__filter:hover { color: var(--fg); background: var(--surface); }
.dt__filter--active { color: var(--accent); }

/* Fixed, and a child of <body>: inside .dt__scroll the panel would be clipped by
   the horizontal overflow instead of floating above the table. */
.dt__filter-panel {
  position: fixed;
  z-index: 40;
  display: grid;
  gap: var(--space-2);
  width: 15rem;
  padding: var(--space-3);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  text-transform: none;
  letter-spacing: normal;
}
.dt__filter-head {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--fg-muted);
}
.dt__filter-search {
  width: 100%;
  padding: var(--control-pad-y) var(--space-2);
  line-height: var(--leading-tight);
  border: var(--border-width) solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-sm);
}
.dt__filter-list { max-height: 14rem; overflow-y: auto; display: grid; gap: var(--space-1); }
.dt__filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--fg);
  cursor: pointer;
}
.dt__filter-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt__filter-item--all {
  padding-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
}
.dt__filter-foot { display: flex; justify-content: flex-end; gap: var(--space-2); }

.dt__resize {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--space-2);
  height: 100%;
  cursor: col-resize;
}
.dt__resize:hover { background: var(--accent); opacity: 0.35; }

.dt__th--dragging { opacity: 0.4; }
.dt__th--drop { box-shadow: inset var(--border-width-accent) 0 0 0 var(--accent); }

.empty__hint { font-size: var(--text-sm); }

/* --- Dialog footer: record actions left, save and cancel right ------------ */
.dialog__foot-left,
.dialog__foot-right { display: flex; align-items: center; gap: var(--space-2); }
.btn--icon { padding: var(--control-pad-y); }
/* An icon alone sits in a square: as wide as every control is tall. The small
   one in a table row keeps its own size. */
.btn--icon:not(.btn--sm) { width: var(--control-height); justify-content: center; }

/* A filtered column says so three times over: filled funnel, accent colour, and
   the number of selected values. One of the three is easy to miss. */
.dt__filter--active {
  color: var(--accent);
  background: var(--accent-subtle);
}
.dt__filter-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1;
}


/* --- Number fields --------------------------------------------------------
   "Besetzt ab" holds one digit. A field as wide as a host name invites somebody
   to look for more to type. */
.field__input--number { width: 7rem; }
.field--narrow { max-width: 12rem; }

/* --- Password fields ------------------------------------------------------
   Show and copy sit inside the field, not next to it: they belong to the value,
   and on a narrow screen a button beside the field would wrap onto its own row.

   The buttons sit in a row of their own rather than being placed one by one. Not
   every password field gets all three -- the current password when signing in
   again has nothing to generate and nothing worth copying -- and positions
   counted off the element order left a gap the moment one was missing. */
.field__with-adornments { position: relative; display: flex; align-items: center; }
.field__adornments {
  position: absolute;
  right: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
/* Room for as many buttons as there are. */
.field__with-adornments--1 .field__input { padding-right: 2.4rem; }
.field__with-adornments--2 .field__input { padding-right: 4.3rem; }
.field__with-adornments--3 .field__input { padding-right: 6.2rem; }
.field__adornment {
  display: inline-flex;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-subtle);
  cursor: pointer;
}

/* A password is typed, not read: 32 characters is wider than any of them needs,
   and a field the width of the card invites the question what else goes in it. */
.field--short .field__with-adornments,
.field--short .field__input { max-width: 32ch; }
.field__adornment:disabled { opacity: 0.35; cursor: default; }
.field__adornment:disabled:hover { background: none; color: var(--fg-subtle); }
.field__adornment:hover { color: var(--fg); background: var(--surface-muted); }
.field__adornment[aria-pressed="true"] { color: var(--accent); }

/* --- Dialog: two columns, grouped -----------------------------------------
   A settings form in one column turns into a scroll bar, and the fields that
   belong together end up a screen apart. */
.dialog__section + .dialog__section { margin-top: var(--space-5); }
.dialog__section-title,
.field-group__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
}
.dialog__section-hint {
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  margin-bottom: var(--space-3);
}
.dialog__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
  align-items: start;
}
/* One field per row. For a list read down the page -- the tenants of a user --
   where two columns make the eye jump to take in one answer. */
.dialog__grid--stacked { grid-template-columns: minmax(0, 1fr); }

/* One field across both columns -- right for a text area of dial patterns. */
.field--wide { grid-column: 1 / -1; }
.field--wide.field--narrow { max-width: none; }

/* Every panel in the same grid cell: the dialog is as tall as its tallest tab
   and keeps that height while one switches between them. */
.dialog__panels { display: grid; }
.dialog__panels > .dialog__panel { grid-area: 1 / 1; }
.dialog__panel--behind { visibility: hidden; }

.dialog__tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: var(--border-width) solid var(--border);
}
.dialog__tab {
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-bottom: var(--border-width-accent) solid transparent;
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}
.dialog__tab:hover { color: var(--fg); }
.dialog__tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* One column once there is no room for two. */
@media (max-width: 40rem) {
  .dialog__grid { grid-template-columns: 1fr; }
}

/* --- Log ------------------------------------------------------------------ */
.log__refresh { display: inline-flex; align-items: center; gap: var(--space-2); }
.log__changes {
  max-height: 20rem;
  overflow: auto;
  padding: var(--space-3);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  word-break: break-word;
}


/* --- Tenant picker in the status bar -------------------------------------
   It says WHERE one is working. What one is looking at is the page title, and
   saying it twice only pushes the content further down. */
.picker-holder { display: inline-flex; align-items: center; }
.picker {
  max-width: 16rem;
  padding: var(--space-1) var(--space-2);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.picker:hover { border-color: var(--border-strong); background: var(--surface); }
.picker__static { font-weight: var(--weight-medium); }

/* --- Not deployed yet -----------------------------------------------------
   A permanent warning is furniture; a mark that appears only where something
   actually changed is read. The menu entry gets a dot, the row a warm edge. */
.nav__link--pending { position: relative; }
.nav__pending {
  width: var(--space-2);
  height: var(--space-2);
  margin-left: auto;
  border-radius: 50%;
  background: var(--warning);
  flex: 0 0 auto;
}
/* "Ausrollen" pulses while something is waiting: that entry asks for an action,
   the other marks only report a state. Since 0.96.0 it stands at the top of the
   menu, outside every group, so nothing can be folded over it -- the rule that let
   a folded heading pulse in its stead went with the group.
   Stopped for anybody who has asked their system not to animate: a blinking dot
   is exactly what that setting is about. */
.nav__link--calling .nav__pending,
.quick__link--calling .nav__pending {
  /* The same size as a plain mark -- the BEAT is what carries it, and a dot
     grown half again as large read as a blob rather than as a signal. It still
     swells while it pulses, which is where the attention comes from. */
  width: var(--space-2);
  height: var(--space-2);
  animation: nav-pulse 1.4s ease-in-out infinite;
}
@keyframes nav-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--warning-ring);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.7);
    box-shadow: 0 0 0 var(--space-2) transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav__link--calling .nav__pending,
  .quick__link--calling .nav__pending { animation: none; }
}

/* The kind of page, beside its name (0.96.0). Quiet: it is a label, not a
   message -- one reads it once per page and then works. */
.page__kind {
  display: inline-block;
  margin-top: var(--space-1);
  padding: 0 var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.dt__row--pending td:first-child {
  box-shadow: inset var(--border-width-marker) 0 0 var(--warning);
}
.dt__row--pending td { background: var(--warning-subtle); }

/* A name with its marks: the star of a favourite, a conflict, a stilled entry. */
.row-name { display: inline-flex; align-items: center; gap: var(--space-2); }
.row-name__star { color: var(--warning); flex: none; }


/* --- The routing map -------------------------------------------------------
   Three columns: the palette, the picture, what is selected. Everything drawn
   is SVG with classes; the colours come from --graph-* in tokens.css, one per
   kind, so the three themes keep working without a block here. */
.graph-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 54rem) {
  .graph-page { grid-template-columns: minmax(0, 1fr); }
}
/* "Neu anlegen": a button among the others, and a list that opens under it. */
.graph-new { position: relative; }
.graph-new__list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  list-style: none;
  min-width: 14rem;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.graph-new__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--fg);
  text-decoration: none;
  font-size: var(--text-sm);
}
.graph-new__item:hover,
.graph-new__item:focus-visible { background: var(--surface-muted); }
.graph-new__item .icon { width: var(--space-4); height: var(--space-4); color: var(--fg-muted); }
.graph-stage {
  position: relative;
  height: var(--graph-stage-height);
  overflow: hidden;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}
.graph {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  /* The drag is ours, on a touch screen too: without this the browser scrolls
     the page instead of moving the picture. */
  touch-action: none;
  user-select: none;
  outline: none;
}
.graph--dragging { cursor: grabbing; }
.graph:focus-visible { box-shadow: var(--focus-ring); }

.graph__node { cursor: pointer; }
.graph--editable .graph__node { cursor: move; }
/* The raster boxes snap to: faint dots, only while it is on. */
.graph__grid { pointer-events: none; }
.graph__grid-dot { fill: var(--graph-grid-dot); }
/* The frame that selects several boxes: as thin on screen at every zoom. */
/* See-through: 80 % transparent, so what the frame takes in stays readable
   while it is drawn (17.09.2026). A solid tint covered the boxes being chosen. */
/* A box nothing leads to and nothing leads away from (0.74.0, asked for).
   Red and dashed -- it is not an error, one builds that way, but it is the
   one thing about a box one wants to see from across the room. */
.graph__node--lonely .graph__box {
  stroke: var(--danger);
  stroke-dasharray: 6 4;
}
.graph__node--lonely .graph__bar { fill: var(--danger); }

.graph__marquee {
  fill: var(--accent);
  fill-opacity: 0.2;
  stroke: var(--accent);
  stroke-width: calc(1px / var(--graph-zoom, 1));
  pointer-events: none;
}
/* "auflegen" and "besetzt" as places to drop an arrow, while one is dragged. */
.graph-drops {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-2);
  z-index: 5;
}
.graph-drop {
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) dashed var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 600;
  pointer-events: none;
}
.graph-drop--over { background: var(--accent-subtle); border-style: solid; }
.graph__box {
  fill: var(--graph-box);
  stroke: var(--graph-box-stroke);
  stroke-width: 1.2;
  filter: var(--graph-box-shadow);
}
.graph__bar { fill: var(--graph-box-stroke); }
/* A folded group: the box behind it shows that there is more than one. */
.graph__stack {
  fill: color-mix(in srgb, var(--graph-group) 12%, var(--graph-box));
  stroke: var(--graph-group);
  stroke-width: 1.6;
  filter: var(--graph-box-shadow);
}
/* And the folded box in front of the pile carries the same edge, so a group
   reads as a group before anybody looks at what is written on it. */
.graph__node--group .graph__box { stroke: var(--graph-group); stroke-width: 1.8; }
.graph__node--group .graph__bar { fill: var(--graph-group); }
.graph-side__group { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
/* An opened group: seen as one, behind its boxes, never in the way of a press. */
/* An opened group (0.61.3): its own colour, and a SOLID edge.
   It was dashed, like a box whose change has not been deployed, and in the
   accent colour, like a box a call is passing through right now. Three
   meanings cannot share two signals. */
.graph__frame-box {
  fill: var(--graph-group);
  fill-opacity: 0.1;
  stroke: var(--graph-group);
  stroke-opacity: 0.8;
  stroke-width: calc(2px / var(--graph-zoom, 1));
  pointer-events: none;
}
/* The band of an opened group's name is its handle (1.7.4): pressed there, the
   whole group moves. Nothing to see -- the name and the edge show where it is
   -- but it takes the press, which the frame's ground deliberately does not. */
.graph__frame-grip {
  opacity: 0;
  cursor: move;
}
.graph__frame-label {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  fill: var(--graph-group);
  text-transform: uppercase;
  pointer-events: none;
}
/* The plus and the minus that open and fold a group. */
.graph__toggle { cursor: pointer; }
.graph__toggle-box { fill: var(--graph-box); stroke: var(--graph-group); stroke-width: 1.2; }
.graph__toggle-mark { fill: none; stroke: var(--graph-group); stroke-width: 1.8; stroke-linecap: round; }
.graph__toggle:hover .graph__toggle-box,
.graph__toggle:focus-visible .graph__toggle-box { fill: var(--graph-group); }
.graph__toggle:hover .graph__toggle-mark,
.graph__toggle:focus-visible .graph__toggle-mark { stroke: var(--accent-contrast); }
.graph__icon { color: var(--graph-text-muted); }
.graph__title {
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  fill: var(--graph-text);
}
.graph__subtitle,
.graph__port-label {
  font-family: var(--font);
  font-size: var(--text-xs);
  fill: var(--graph-text-muted);
}
.graph__node--selected .graph__box { stroke: var(--graph-edge-strong); stroke-width: 2.4; }
.graph__node--pending .graph__box { stroke-dasharray: 5 3; stroke: var(--warning); }
.graph__node--problem .graph__box { stroke: var(--danger); stroke-width: 2; }
/* An option for something switched off (0.113.0): marked in its text, and dimmed
   where the browser lets an option be styled. */
.field__option--inactive { color: var(--fg-subtle); }

.graph__node--inactive { opacity: 0.45; }
.graph__node--dim { opacity: 0.35; }
/* Live. A call is here: a strong frame. A call went through: a thin one.
   Ringing pulses. After pending and problem: what happens now is what counts. */
.graph__node--live .graph__box { stroke: var(--graph-live); stroke-width: 3; }
.graph__node--live-passing .graph__box { stroke: var(--graph-live); stroke-width: 1.8; }
.graph__node--live-talking .graph__box { stroke: var(--graph-live); stroke-width: 3; }
.graph__node--live-ringing .graph__box {
  stroke: var(--graph-live-ringing);
  stroke-width: 3;
  animation: graph-live-ring 0.9s ease-in-out infinite alternate;
}
/* And a ground of their own, so the whole way of a call stands out at a glance:
   one tint for every box on it, whether the call is there or passed through,
   one call or several -- levels of tint read as layers (17.09.2026). */
.graph__node--live-ringing .graph__box { fill: var(--graph-live-ringing-fill); }
/* After ringing: a telephone in a call that rings for a second one stays orange,
   and its frame pulses. */
.graph__node--live .graph__box,
.graph__node--live-passing .graph__box,
.graph__node--live-talking .graph__box { fill: var(--graph-live-fill); }
.graph__node--live-offline .graph__title { fill: var(--graph-text-muted); }
.graph__live-dot--ok { fill: var(--graph-live-ok); }
.graph__live-dot--off { fill: var(--graph-live-off); }
.graph__live-dot--bad { fill: var(--graph-live-bad); }
.graph__live-count circle { fill: var(--graph-live); }
.graph__live-count text {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  fill: var(--accent-contrast);
}

/* One colour per kind, on the bar and the icon -- the box itself stays the
   surface so the text stays readable in every theme. */
.graph__node--trunk .graph__bar, .graph__node--trunk .graph__icon,
.graph__node--trunk_out .graph__bar, .graph__node--trunk_out .graph__icon { fill: var(--graph-trunk); color: var(--graph-trunk); }
.graph__node--inbound_route .graph__bar, .graph__node--inbound_route .graph__icon { fill: var(--graph-inbound-route); color: var(--graph-inbound-route); }
.graph__node--outbound_route .graph__bar, .graph__node--outbound_route .graph__icon { fill: var(--graph-outbound-route); color: var(--graph-outbound-route); }
.graph__node--feature_code .graph__bar, .graph__node--feature_code .graph__icon { fill: var(--graph-feature-code); color: var(--graph-feature-code); }
.graph__node--time_condition .graph__bar, .graph__node--time_condition .graph__icon { fill: var(--graph-time-condition); color: var(--graph-time-condition); }
.graph__node--ivr .graph__bar, .graph__node--ivr .graph__icon { fill: var(--graph-ivr); color: var(--graph-ivr); }
.graph__node--announcement .graph__bar, .graph__node--announcement .graph__icon { fill: var(--graph-announcement); color: var(--graph-announcement); }
.graph__node--ring_group .graph__bar, .graph__node--ring_group .graph__icon { fill: var(--graph-ring-group); color: var(--graph-ring-group); }
.graph__node--queue .graph__bar, .graph__node--queue .graph__icon { fill: var(--graph-queue); color: var(--graph-queue); }
.graph__node--extension .graph__bar, .graph__node--extension .graph__icon { fill: var(--graph-extension); color: var(--graph-extension); }
.graph__node--voicemail .graph__bar, .graph__node--voicemail .graph__icon { fill: var(--graph-voicemail); color: var(--graph-voicemail); }
.graph__node--conference .graph__bar, .graph__node--conference .graph__icon { fill: var(--graph-conference); color: var(--graph-conference); }
.graph__node--parking_lot .graph__bar, .graph__node--parking_lot .graph__icon { fill: var(--graph-parking-lot); color: var(--graph-parking-lot); }
.graph__node--external .graph__bar, .graph__node--external .graph__icon { fill: var(--graph-external); color: var(--graph-external); }
/* The kind's colour reaches the icon as its line colour only. The rules above
   set fill for the bar and, with it, for the icon -- which painted the menu's
   line icons solid and made them unrecognisable blots (17.09.2026). */
.graph__node .graph__icon { fill: none; }

.graph__edge {
  fill: none;
  stroke: var(--graph-edge);
  stroke-width: 1.6;
}
.graph__edge--back { stroke-dasharray: 6 4; }
.graph__edge--selected { stroke: var(--graph-edge-strong); stroke-width: 2.4; }
.graph__arrow { fill: var(--graph-edge); }
/* The arrows a call is on run in the direction of the call. */
.graph__edge--live {
  stroke: var(--graph-live);
  stroke-width: 2.8;
  stroke-dasharray: 8 6;
  animation: graph-live-flow 0.8s linear infinite;
}
.graph__arrow--live { fill: var(--graph-live); }
@keyframes graph-live-ring { from { stroke-opacity: 1; } to { stroke-opacity: 0.3; } }
@keyframes graph-live-flow { to { stroke-dashoffset: -14; } }
@media (prefers-reduced-motion: reduce) {
  .graph__node--live-ringing .graph__box,
  .graph__edge--live { animation: none; }
}
.graph-side__facts { margin: 0; }
.graph-side__call .graph-side__port { min-width: 3rem; }
.graph-side__who { display: grid; gap: var(--space-1); }

/* "Einstellungen übertragen": what waits on the left, the nodes it goes to on the right. */
.deploy-page {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-5);
  align-items: start;
}
.deploy-page__changes,
.deploy-page__nodes { display: grid; gap: var(--space-3); align-content: start; }
@media (max-width: 54rem) {
  .deploy-page { grid-template-columns: minmax(0, 1fr); }
}

/* Pending changes and the way back: one block per object, the fields under it. */
.revert__row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
  padding-block: var(--space-2);
  border-block-end: var(--border-width) solid var(--border);
}
.revert__change { display: grid; gap: var(--space-1); margin-block: var(--space-2); }
.revert__head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.revert__type { color: var(--fg-muted); font-size: var(--text-sm); }
.revert__fields { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.revert__field { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.revert__name { color: var(--fg-muted); min-width: 10rem; }

/* The directory on the nodes: one dot per node, in a line above the list. */
.delivery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin-block-end: var(--space-3);
  font-size: var(--text-sm);
}
.delivery__label { color: var(--fg-muted); }

/* While an arrow is being dragged: where it may land, and where it may not. */
.graph__node--target .graph__box { stroke: var(--graph-edge-strong); stroke-dasharray: 3 3; }
.graph__node--over .graph__box { stroke-width: 3; fill: var(--accent-subtle); }
/* The arrow in hand: as thick on screen at a fitted zoom as at full size.
   Divided by the zoom the page writes onto the picture, not non-scaling-stroke:
   Chromium draws that inside a scaled group as a stub of a hook, and its tip
   with it. The tip is sized in stroke widths, so it follows along. */
.graph__drag {
  fill: none;
  stroke: var(--accent);
  stroke-width: calc(3px / var(--graph-zoom, 1));
  pointer-events: none;
}
.graph__arrow--drag { fill: var(--accent); }
.graph__edge--moving { opacity: 0.2; }
/* Invisible, but painted: a transparent fill still takes the pointer. */
.graph__hit { fill: transparent; stroke: none; }
.graph__edge--picked { stroke: var(--warning); stroke-width: 2.4; }
.graph__port--handle { cursor: crosshair; }
.graph__port--picked .graph__dot,
.graph__port--picked .graph__stop { stroke: var(--warning); fill: var(--warning); }
.graph-notices:empty { display: none; }

/* The narrowed view (0.101.0): which way in, and the way back to all of it. */
.graph-scope {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.graph-scope__what { font-weight: var(--weight-medium); }
/* A box that is reached from outside the view as well: "← 2" on its left edge,
   in the warning colour -- not an error, but what one has to know before
   changing it. */
.graph__node--shared .graph__box { stroke: var(--warning); }
.graph__shared {
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  fill: var(--warning);
  text-anchor: end;
  cursor: help;
}

/* A port that leads somewhere is FILLED, one that leads nowhere is hollow
   (0.69.0) -- the same language the building-block editor speaks, so the two
   pictures can be read with one pair of eyes. The dashes went: a dashed ring
   at this size reads as a fuzzy dot, not as "empty". */
.graph__dot { fill: var(--graph-edge); stroke: var(--graph-edge); stroke-width: 1.4; }
.graph__port--empty .graph__dot { fill: var(--graph-box); }
.graph__port--empty .graph__port-label { opacity: 0.6; }
.graph__stop { fill: var(--graph-edge); }


.graph-side { display: grid; gap: var(--space-3); align-content: start; }
.graph-side__head { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.graph-side__title { margin: 0; font-size: var(--text-lg); }
.graph-side__details { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: 0; font-size: var(--text-sm); }
.graph-side__details dt { color: var(--fg-muted); }
.graph-side__details dd { margin: 0; }
.graph-side__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.graph-side__row { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); }
.graph-side__port { color: var(--fg-muted); font-size: var(--text-xs); min-width: 7rem; }
.graph-side__link { color: var(--accent); text-decoration: none; }
.graph-side__link:hover { text-decoration: underline; }
.graph-problem { display: grid; gap: var(--space-2); }

/* --- API-Dokumentation ------------------------------------------------ */
/* Eine Seite, die aus der Beschreibung des Servers gebaut wird: viele Tabellen,
   viel Schrift im Festbreitensatz, und Themen, die sich zuklappen lassen
   (17.09.2026). */
.api__groups { display: grid; gap: var(--space-2); }
.api__group {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.api__group > .btn { width: 100%; justify-content: flex-start; }
.api__calls {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border-top: var(--border-width) solid var(--border);
}
/* Jede Funktion als eigene Karte: in einem Block stehen zwanzig davon
   untereinander, und ohne Absetzung liest sich das als eine einzige lange Wand
   (18.09.2026). */
.api__call {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
/* Die Überschrift führt in den Test -- deshalb ist sie ein Link und sieht auch
   so aus, sobald der Zeiger darauf steht. */
.api__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0;
  font-size: var(--text-md);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
}
.api__head:hover { background: var(--surface-muted); }
.api__head:focus-visible { box-shadow: var(--focus-ring); }
.api__go { margin-left: auto; color: var(--fg-subtle); flex: 0 0 auto; }
/* Die Methode als Marke davor: GET liest, DELETE nicht. */
.api__method {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--border);
  color: var(--fg-muted);
}
.api__method--get { color: var(--success); border-color: var(--success); }
.api__method--post { color: var(--accent); border-color: var(--accent); }
.api__method--patch,
.api__method--put { color: var(--warning); border-color: var(--warning); }
.api__method--delete { color: var(--danger); border-color: var(--danger); }
.api__summary { margin: 0; color: var(--fg-muted); }
/* Der Text aus dem Quelltext steht dort mit eigenen Umbrüchen. */
.api__text { margin: 0; white-space: pre-wrap; }
.api__sub { margin: var(--space-2) 0 var(--space-1); font-size: var(--text-sm); color: var(--fg-muted); }
.api__answers { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.api__limits { display: grid; gap: calc(var(--space-1) / 2); }
.api__limit { font-size: var(--text-sm); color: var(--fg-muted); }
.api__required { margin-left: var(--space-2); font-size: var(--text-xs); color: var(--danger); }
/* Die Tabelle darf breiter sein als die Seite -- sie scrollt in sich. */
.api__table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}
.api__table th,
.api__table td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-1) var(--space-2);
  border-bottom: var(--border-width) solid var(--border);
  font-size: var(--text-sm);
}
.api__table th { color: var(--fg-muted); font-weight: var(--weight-medium); }
.api__result { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.api__json {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  max-height: 32rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Zwei Spalten je Funktion: links, was sie tut und zurückgibt, rechts, was sie
   nimmt (18.09.2026). Unter 54rem untereinander – dort ist eine Tabelle neben
   einer Tabelle keine Hilfe mehr. */
.api__columns {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.api__half { display: grid; gap: var(--space-1); min-width: 0; }
.api__subject {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
}
/* Suchfeld und Download nebeneinander, das Feld nimmt den Platz. */
.api__bar { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--space-3); }
.api__bar .field { flex: 1 1 18rem; }
@media (max-width: 54rem) {
  .api__columns { grid-template-columns: 1fr; }
}
/* Suche und Aufruf untereinander, in lesbarer Breite statt über die ganze
   Seite (18.09.2026). */
.api__picker { display: grid; gap: var(--space-3); max-width: 44rem; }
/* Wer gerade lesen darf: Adresse und das Gerät dahinter, eins je Zeile. */
/* A forward that holds right now but stands in no file here: it lives on the
   telephone system (0.55.0, "now" rather than "temporary" since 0.58.0 -- a
   person's ordinary setting lives there too). Dashed and in the warning
   colour: it is true at this moment and not necessarily tomorrow. The
   configured edge it overrides is dimmed beside it. */
.graph__edge--now {
  stroke: var(--warning);
  stroke-dasharray: 2 3;
  stroke-width: calc(var(--stroke-width) * 1.2);
}
.graph__edge--overridden { opacity: .35; }
.graph__node--now rect { stroke: var(--warning); stroke-width: 2; }

/*
 * A number with its mark (0.57.0): abroad, a mobile, or one that costs
 * something out of the ordinary. Quiet -- it sits in every list, and a loud
 * mark repeated forty times is noise. The service one is the warning colour:
 * it is the only one that costs money.
 */
.number { display: inline-flex; align-items: center; gap: var(--space-1); }
.number__mark { flex: none; color: var(--fg-muted); }
/* The place a mark would take, kept empty: a column of numbers in which some
   rows are indented and others are not has stopped being a column. */
.number__mark--none { display: inline-block; }
.number__mark--service { color: var(--warning); }

/* The star in the directory list (0.52.0): a button with nothing around it, so
   the row reads as a row and the star still answers a click. Unmarked it is
   drawn faintly -- there has to be something to press, and an empty space is
   not it. */
.row-name__starbtn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  line-height: 0;
}
.row-name__starbtn:disabled { cursor: default; opacity: .5; }
.row-name__star--off { color: var(--fg-subtle); opacity: .45; }
.row-name__starbtn:hover .row-name__star--off { opacity: .9; }
/*
 * The four states, each its own colour (0.80.0): a star for what is wanted
 * first, an eye struck through for what one does not want to see, a bin for
 * what should not be there at all. Colour as well as shape, because the icons
 * are small and the row is long.
 */
/* The three buttons side by side, with a hair of air between them (0.81.0). */
.row-marks { display: inline-flex; gap: var(--space-1); flex: none; }
.row-name__starbtn--on { background: var(--surface-muted); border-radius: var(--radius-sm); }
/*
 * What can still be done is quiet; what IS done speaks (0.82.0, asked for).
 *
 * A bin that can still be pressed wears the same quiet grey as the eye beside
 * it -- it is an offer, not a state. Once the entry is thrown away the button
 * shows the recycling arrows in the colour of a warning: that one says "this
 * is gone, and I bring it back".
 */
.row-name__star--unimportant,
.row-name__star--deleted { color: var(--fg-subtle); opacity: .75; }
.row-name__star--set.row-name__star--unimportant { color: var(--fg-subtle); opacity: 1; }
.row-name__star--set.row-name__star--deleted { color: var(--danger); opacity: 1; }

.peers { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.peers li { display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
/* One row per address, not per registration: a DECT base with three handsets is
   one device on the network (18.09.2026). What identifies it -- the reverse name
   and the MAC -- stands next to the address, the registrations below it. */
.peers__name { font-weight: 600; }
.peers__mac { color: var(--fg-muted); }
/* Just arrived: a row that lights up once, so a list that refreshes itself does
   not have to be compared by eye. */
.peers li.peers--new { animation: peer-in 2.5s ease-out 1; }
@keyframes peer-in {
  from { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  to { background: transparent; }
}
/* And one that has just gone: shown once more, faded, then dropped. */
.peers li.peers--gone { opacity: .55; text-decoration: line-through; }
/* A button that opens a short list of actions (18.09.2026). Built on <details>:
   opening, closing and the keyboard come with the browser. */
.menu { position: relative; display: inline-block; }
.menu__head { list-style: none; cursor: pointer; user-select: none; }
.menu__head::-webkit-details-marker { display: none; }
.menu__list {
  position: absolute;
  z-index: 30;
  right: 0;
  margin-top: var(--space-1);
  min-width: 14rem;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.menu__list .btn { justify-content: flex-start; width: 100%; }
/* Upwards where there is no room below -- ui.js sets the class when the menu
   opens, because only then is it known how much room lies under it (18.09.2026). */
.menu--up .menu__list { top: auto; bottom: 100%; margin-top: 0; margin-bottom: var(--space-1); }
/* A list without a scroll area of its own: for a dialog that already scrolls.
   Two scrollbars for one list mean scrolling twice to reach its end (18.09.2026). */
.checks--plain {
  max-height: none;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
}

/* ---------------------------------------------------------------------------
   Anrufabläufe (0.61.0)

   The editor for one flow: boxes the person places, exits they connect. The
   colours come from the same tokens the routing map uses -- two pictures of
   the same telephone system should not look like two products -- but the
   layout is its own: this one is drawn by hand and therefore scrolls rather
   than fitting itself into the window.
--------------------------------------------------------------------------- */
/* The editor takes the height it is given (0.67.0): the page is a column, the
   picture is the part of it that stretches. A fixed height left a third of a
   tall screen empty and made a long flow scroll in a letterbox. */
.flow-page { display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; flex: 1 1 auto; }

.flow-page__split {
  display: grid;
  /* The palette is a column of buttons in six groups; twenty rem put two of
     them on a line and the rest below (0.71.1, asked for). */
  grid-template-columns: minmax(0, 1fr) 26rem;
  gap: var(--space-3);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 54rem) {
  .flow-page__split { grid-template-columns: minmax(0, 1fr); }
}

.flow__surface {
  position: relative;
  /* As tall as the page has room for (0.71.1, asked for): the editor is the
     page, not a box on it. The floor keeps it usable on a short window. */
  height: 100%;
  min-height: var(--flow-stage-height);
  overflow: hidden;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.flow {
  display: block;
  min-width: 100%;
  /* The drag is ours, on a touch screen too. */
  touch-action: none;
  user-select: none;
}

.flow__frame {
  fill: var(--graph-box);
  stroke: var(--graph-box-stroke);
  stroke-width: 1.4;
}

/* The class of a step, as a colour (0.70.0, asked for).
   The ground is tinted a little and the left edge carries the full colour --
   that leaves the frame free for what the box IS doing (chosen, the beginning,
   a problem), which is the thing one must not lose. */
.flow__box--group-say .flow__frame { fill: color-mix(in srgb, var(--flow-say) 12%, var(--graph-box)); }
.flow__box--group-connect .flow__frame { fill: color-mix(in srgb, var(--flow-connect) 12%, var(--graph-box)); }
.flow__box--group-decide .flow__frame { fill: color-mix(in srgb, var(--flow-decide) 14%, var(--graph-box)); }
.flow__box--group-wait .flow__frame { fill: color-mix(in srgb, var(--flow-wait) 12%, var(--graph-box)); }
.flow__box--group-note .flow__frame { fill: color-mix(in srgb, var(--flow-note) 10%, var(--graph-box)); }
.flow__box--group-end .flow__frame { fill: color-mix(in srgb, var(--flow-end) 12%, var(--graph-box)); }
.flow__edge { fill: var(--flow-do); }
.flow__box--group-say .flow__edge { fill: var(--flow-say); }
.flow__box--group-connect .flow__edge { fill: var(--flow-connect); }
.flow__box--group-decide .flow__edge { fill: var(--flow-decide); }
.flow__box--group-wait .flow__edge { fill: var(--flow-wait); }
.flow__box--group-note .flow__edge { fill: var(--flow-note); }
.flow__box--group-end .flow__edge { fill: var(--flow-end); }
/* The icon takes the colour of its class as well, so palette and canvas agree. */
.flow__box--group-say .flow__icon { color: var(--flow-say); }
.flow__box--group-connect .flow__icon { color: var(--flow-connect); }
.flow__box--group-decide .flow__icon { color: var(--flow-decide); }
.flow__box--group-wait .flow__icon { color: var(--flow-wait); }
.flow__box--group-note .flow__icon { color: var(--flow-note); }
.flow__box--group-end .flow__icon { color: var(--flow-end); }

.flow__kind { fill: var(--graph-text); font-size: var(--text-md); font-weight: 600; }
/* The picture in front of the name of a step (0.70.0): drawn in the same
   colour as the name, so a box reads as one thing rather than two. */
.flow__icon { color: var(--graph-text); }
.flow__icon use { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.flow__detail { fill: var(--fg-subtle); font-size: var(--text-sm); }
/* The name of an exit (0.66.0, placed by model.js since 0.67.0): inside the
   box where the names of that box fit side by side, on the arrow otherwise --
   there always the same distance below the box, never a share of its length. */
.flow__arrow-label {
  fill: var(--fg-subtle);
  font-size: var(--text-xs);
  text-anchor: middle;
  pointer-events: none;
}
/* The plate: the ground of the box where the name sits in it, the ground of
   the surface where it sits on a line.Half-transparent on the line, so the
   arrow underneath is dimmed rather than cut through. */
.flow__arrow-plate { fill: var(--bg); opacity: 0.85; pointer-events: none; }
.flow__arrow-mark--inside .flow__arrow-plate { fill: var(--graph-box); opacity: 1; }
.flow__arrow-mark--inside .flow__arrow-label { fill: var(--graph-text-muted); }
/* A grab area wider than the dot: five points is hard to hit with a mouse and
   impossible with a finger. */
.flow__grab { fill: transparent; cursor: crosshair; }
/* The name of an exit inside its box, over its dot. */
.flow__exit {
  fill: var(--graph-text-muted);
  font-size: var(--text-xs);
  text-anchor: middle;
  pointer-events: none;
}
/* And the same name at the dot while the pointer rests on it -- for the boxes
   whose names did not fit inside (0.67.0). */
.flow__exit-hover {
  fill: var(--fg);
  font-size: var(--text-xs);
  text-anchor: middle;
  opacity: 0;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.flow__port:hover .flow__exit-hover { opacity: 1; }
.flow__dot { fill: var(--graph-box); stroke: var(--graph-edge); stroke-width: 1.4; cursor: crosshair; }
.flow__dot--taken { fill: var(--graph-edge-strong); stroke: var(--graph-edge-strong); }
.flow__box { cursor: move; }
.flow__box--chosen .flow__frame { stroke: var(--graph-edge-strong); stroke-width: 2.4; }
/* Where the call comes in: the one box with a filled edge. */
.flow__box--first .flow__frame { stroke: var(--accent); stroke-width: 2; }
.flow__box--problem .flow__frame { stroke: var(--warning); stroke-dasharray: 5 3; }
.flow__box--unknown .flow__frame { stroke: var(--danger); }

.flow__arrow { fill: none; stroke: var(--graph-edge); stroke-width: 1.6; }
.flow__arrow--chosen { stroke: var(--graph-edge-strong); stroke-width: 2.2; }
.flow__head { fill: var(--graph-edge); }
/* The buttons at the end of a row: one line, never wrapped (0.70.0, asked
   for). Two short buttons under one another read as two rows of table. */
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  white-space: nowrap;
}

/* The frame pulled open over the surface to take several steps at once
   (0.70.0, asked for) -- the same look the routing map's has. */
.flow__marquee {
  fill: var(--accent);
  fill-opacity: 0.2;
  stroke: var(--accent);
  stroke-width: 1;
  pointer-events: none;
}

.flow__dragline { fill: none; stroke: var(--graph-edge-strong); stroke-dasharray: 4 3; }

.flow-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* The same height as the picture beside it, and scrolls on its own. */
  max-height: 100%;
  min-height: 0;
  overflow: auto;
}
/* Who uses this block, in one line under the page title (0.71.1, asked for).
   Beside the picture it took the room the palette needs, and it belongs to
   the whole block rather than to the drawing. */
.flow-used {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
}
.flow-used__title { color: var(--fg-subtle); }
.flow-used__entry {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  padding: 0 var(--space-2);
  font: inherit;
  cursor: pointer;
}
.flow-used__entry:hover { border-color: var(--fg-subtle); }
.flow-used__entry--plain { cursor: default; color: var(--fg-muted); }

.flow-side__palette { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.flow-side__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.flow-side__row { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; }
.flow-side__exit { color: var(--fg-subtle); font-size: var(--text-sm); min-width: 7rem; }

/* The three zoom buttons of the building-block editor, kept together at the
   right-hand end of the row so they read as one control. */
.flow-zoom { display: flex; gap: var(--space-1); margin-left: auto; }

/* The step a call comes in at: a chip that says so, not just a coloured edge
   -- an edge alone was too close to "this one is chosen" (0.63.0). */
.flow__start-chip { fill: var(--accent); }
.flow__start-text { fill: var(--accent-contrast); font-size: var(--text-xs); font-weight: var(--weight-bold); text-anchor: middle; }

/* The canvas of the building-block editor fills its window; the picture inside
   it is what pans and zooms (0.64.0). */
.flow { width: 100%; height: 100%; }

.flow--panning { cursor: grabbing; }

/* The palette in columns by what a step is (0.67.0). */
.flow-side__group { display: flex; flex-direction: column; gap: var(--space-1); }
.flow-side__group-title { margin: 0; color: var(--fg-subtle); font-size: var(--text-xs); text-transform: uppercase; }

/* The context menu of one step: at the pointer, over the picture (0.67.0). */
/*
 * The menu at the pointer -- the same one in both pictures (0.79.0).
 *
 * The map learnt the gesture from the building blocks, so it wears their
 * clothes: one set of rules, one look, and nothing to drift apart.
 */
.flow-menu,
.graph-menu {
  position: absolute;
  min-width: 19rem;
  max-width: 26rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.graph-menu { z-index: 6; }
.graph-menu__listen { display: flex; flex-direction: column; gap: var(--space-1); }
.flow-menu__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--fg-subtle); font-size: var(--text-xs); font-weight: var(--weight-bold); }
/* The picture of the kind, in the menu and over the settings dialog (0.70.0). */
.flow-menu__icon { width: 1rem; height: 1rem; flex: none; }
.flow-menu__row { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }
.flow-menu__name { color: var(--fg-subtle); min-width: 7rem; }
.flow-menu__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }

/* The name of an exit that leaves sideways: outside the box, beside its
   point -- inside it would land on the title of the step (0.68.0). */
.flow__exit--outside { fill: var(--fg-subtle); }
/* The context menu is as wide as the pickers in it. */
.flow-menu__pick { max-width: 100%; }
