/* =====================================================================
   Backend-Gerüst: feste Seitenleiste links, schwebende Kopfleiste rechts.
   Setzt base.css voraus.
   ===================================================================== */

.app { min-height: 100vh; }

/* --- Seitenleiste --------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-menu);
  transition: width .2s ease, transform .2s ease;
}

.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.1rem 1.5rem 1rem;
  color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand:hover { color: var(--text); }
.brand-mark {
  flex: 0 0 auto;
  display: grid; place-items: center; width: 2rem; height: 2rem;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius); font-size: .75rem; font-weight: 700;
  letter-spacing: .02em; box-shadow: var(--accent-shadow);
}
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }

.sidebar-toggle {
  margin-left: auto; flex: 0 0 auto;
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-muted);
  border-radius: 50%; cursor: pointer;
}
.sidebar-toggle:hover { background: var(--accent-soft); color: var(--accent); }

.sidebar-nav {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: .25rem 0 1.5rem;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.nav-section {
  display: block; margin: 1.1rem 0 .35rem; padding: 0 1.5rem;
  font-size: .8125rem; color: var(--text-muted); position: relative;
  white-space: nowrap; overflow: hidden;
}
.nav-section::before {
  content: ""; position: absolute; left: 1rem; top: 50%; width: .35rem;
  height: 1px; background: var(--border-strong); opacity: 0;
}

.nav-link {
  display: flex; align-items: center; gap: .5rem;
  margin: .125rem .75rem; padding: .5rem .75rem;
  border-radius: var(--radius);
  color: var(--text); text-decoration: none;
  font-size: .9375rem; line-height: 1.4;
  white-space: nowrap; overflow: hidden;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: var(--accent-shadow);
}
.nav-link.active .nav-icon { color: var(--accent-ink); }

.nav-icon { flex: 0 0 1.375rem; width: 1.375rem; height: 1.375rem; color: var(--text-muted); }
.nav-link:hover .nav-icon { color: var(--text); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* --- Unternavigation ------------------------------------------------------ */
.nav-parent {
  width: calc(100% - 1.5rem);
  font: inherit; font-size: .9375rem; text-align: left;
  border: 0; cursor: pointer;
}
.nav-parent.is-current { color: var(--text); background: var(--surface-2); }

.nav-caret {
  flex: 0 0 1rem; width: 1rem; height: 1rem;
  color: var(--text-faint); transition: transform .2s ease;
}
.nav-group.is-open > .nav-parent .nav-caret { transform: rotate(90deg); }

/* Zusammenklappen über max-height statt grid-template-rows: Letzteres würde
   nur die erste Zeile bemaßen, die weiteren <li> landen in impliziten
   auto-Zeilen und bleiben stehen. Der Höchstwert ist großzügig gewählt und
   dient nur der Überblendung. */
.nav-sub {
  list-style: none; margin: 0; padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height .2s ease;
}
.nav-group.is-open > .nav-sub { max-height: 32rem; }
.nav-sub > li:first-child { padding-top: .125rem; }
.nav-sub > li:last-child  { padding-bottom: .25rem; }

.nav-sublink {
  display: flex; align-items: center; gap: .5rem;
  margin: .0625rem .75rem .0625rem 2.35rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  color: var(--text-body); text-decoration: none;
  font-size: .875rem; white-space: nowrap; overflow: hidden;
  transition: background-color .15s ease, color .15s ease;
}
.nav-sublink:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-sublink.active {
  background: var(--accent-grad); color: var(--accent-ink);
  box-shadow: var(--accent-shadow);
}
.nav-dot {
  flex: 0 0 .3rem; width: .3rem; height: .3rem; border-radius: 50%;
  background: currentColor; opacity: .45;
}
.nav-sublink.active .nav-dot { opacity: 1; }

/* Eingeklappt bleibt nur das Symbol - die Unterpunkte erscheinen, sobald die
   Leiste beim Überfahren wieder ausfährt. */
.app.is-collapsed .sidebar:not(:hover) .nav-sub { max-height: 0; }
.app.is-collapsed .sidebar:not(:hover) .nav-caret { opacity: 0; }

.sidebar-foot {
  padding: .75rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--text-faint);
  white-space: nowrap; overflow: hidden;
}

/* --- eingeklappt (nur Symbole) --------------------------------------------- */
.app.is-collapsed .sidebar { width: var(--sidebar-sm); }
.app.is-collapsed .sidebar .brand-name,
.app.is-collapsed .sidebar .nav-text,
.app.is-collapsed .sidebar .sidebar-foot,
.app.is-collapsed .sidebar .nav-section { opacity: 0; pointer-events: none; }
.app.is-collapsed .sidebar .nav-section { height: 1.25rem; margin: .75rem 0 .25rem; }
.app.is-collapsed .sidebar-brand { padding-inline: 1.4rem; }
.app.is-collapsed .sidebar-toggle { display: none; }
.app.is-collapsed .nav-link { margin-inline: .875rem; padding-inline: .6rem; }
.app.is-collapsed .content { margin-left: var(--sidebar-sm); }
.app.is-collapsed .sidebar:hover { width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
.app.is-collapsed .sidebar:hover .brand-name,
.app.is-collapsed .sidebar:hover .nav-text,
.app.is-collapsed .sidebar:hover .sidebar-foot,
.app.is-collapsed .sidebar:hover .nav-section { opacity: 1; pointer-events: auto; }

/* --- Inhaltsbereich --------------------------------------------------------- */
.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .2s ease;
}

.navbar {
  position: sticky; top: 1rem; z-index: 40;
  margin: 1rem 1.5rem 0;
  display: flex; align-items: center; gap: .75rem;
  height: 3.5rem; padding: 0 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-menu);
}
.navbar-burger {
  display: none;
  width: 2.25rem; height: 2.25rem; place-items: center;
  border: 0; background: transparent; color: var(--text-body);
  border-radius: 50%; cursor: pointer;
}
.navbar-burger:hover { background: var(--accent-soft); color: var(--accent); }
.navbar-title {
  font-size: 1rem; font-weight: 500; color: var(--text);
  /* Auf dem Telefon brach eine lange Überschrift die Leiste auf drei
     Zeilen auf und schob sich über den Inhalt. Lieber abschneiden. */
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.navbar-spacer { flex: 1; }

.navbar select {
  width: auto; min-width: 9rem; padding: .3rem 2rem .3rem .75rem;
  font-size: .8125rem; border-radius: var(--radius);
}

.user-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .25rem .5rem .25rem .25rem; border-radius: 999px;
  color: var(--text); text-decoration: none;
}
.user-chip:hover { background: var(--surface-2); color: var(--text); }
.user-avatar {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 2.125rem; height: 2.125rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: .8125rem; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: .875rem; font-weight: 500; }
.user-meta small { font-size: .75rem; color: var(--text-muted); }
@media (max-width: 780px) { .user-meta { display: none; } }

.page { flex: 1; padding: 1.5rem; max-width: 100%; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.page-head h1 { margin-bottom: .2rem; }
.page-head .subtitle { margin: 0; }

.footer { padding: 0 1.5rem 1.5rem; color: var(--text-faint); font-size: .8125rem; }

/* --- kleine Bildschirme: Schublade ------------------------------------------- */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(47, 43, 61, .5); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .content { margin-left: 0; }
  .navbar-burger { display: grid; }
  .app.is-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.is-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  .app.is-collapsed .sidebar { width: var(--sidebar-w); }
  .app.is-collapsed .content { margin-left: 0; }
  .sidebar-toggle { display: none; }
}

@media (max-width: 640px) {
  .page, .navbar { margin-inline: 0; }
  .navbar { margin: .75rem; }
  .page { padding: .75rem; }
  .footer { padding: 0 .75rem 1rem; }
  .table-wrap { margin: 0 -1.5rem; }
}

/* --- geteilte Ansicht mit Baum ------------------------------------------------ */
.split { display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1200px) { .split { grid-template-columns: 1fr; } }

.tree-panel { position: sticky; top: 5.75rem; max-height: calc(100vh - 7.5rem); overflow-y: auto; }

/* --- Baum ---------------------------------------------------------------------- */
.tree { --indent: 1.1rem; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 var(--indent); }
.tree > ul { padding-left: 0; }
.tree li { position: relative; margin: 1px 0; }
.tree ul ul::before {
  content: ""; position: absolute; left: calc(var(--indent) * -1 + .55rem);
  top: 0; bottom: 0; width: 1px; background: var(--border);
}

.tree-row {
  display: flex; align-items: center; gap: .35rem;
  padding: .35rem .5rem; border-radius: var(--radius);
  color: var(--text-body); font-size: .9375rem;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.is-active { background: var(--accent-grad); box-shadow: var(--accent-shadow); }
.tree-row.is-active .tree-name,
.tree-row.is-active .tree-icon,
.tree-row.is-active .tree-toggle { color: var(--accent-ink); }
.tree-row.is-active .tree-count {
  background: rgba(255, 255, 255, .25); color: var(--accent-ink); border-color: transparent;
}
.tree-row.is-disabled .tree-name { opacity: .55; text-decoration: line-through; }

.tree-toggle {
  flex: 0 0 1.05rem; width: 1.05rem; height: 1.05rem; padding: 0;
  border: 0; background: none; color: var(--text-faint);
  cursor: pointer; font-size: .55rem; line-height: 1;
  display: grid; place-items: center;
}
.tree-toggle:hover { color: var(--text); }
.tree-toggle[hidden] { visibility: hidden; display: grid; }

.tree-icon { flex: 0 0 auto; font-size: .8rem; opacity: .85; }
.tree-name {
  flex: 1; min-width: 0; color: inherit; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-name:hover { color: inherit; }
.tree-count {
  flex: 0 0 auto; min-width: 1.5rem; text-align: center;
  background: var(--surface-3); color: var(--text-muted);
  border: 0; border-radius: 999px;
  font-size: .6875rem; line-height: 1.25rem; padding: 0 .4rem;
}
.tree li.collapsed > ul { display: none; }

/* --- Kleinteile ------------------------------------------------------------------ */
.token-list { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .6rem; }
.token-list code { font-size: .75rem; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.25rem; }
.kv dt {
  font-size: .75rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: .15rem;
}
.kv dd { margin: 0; font-size: .9375rem; color: var(--text-body); }

.section-links { display: flex; gap: .5rem; flex-wrap: wrap; }

/* --- Anmeldeseite ------------------------------------------------------------------ */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); }
.login-card { width: min(26rem, 100%); }
.login-card .panel { padding: 2rem; box-shadow: var(--shadow-lg); margin: 0; }
.login-card .brand-mark { width: 2.5rem; height: 2.5rem; font-size: .875rem; margin-bottom: 1.25rem; }
.login-card h1 { font-size: 1.375rem; font-weight: 600; }
.login-card .field { margin-bottom: 1rem; }
.login-foot {
  margin-top: 1.25rem; display: flex; justify-content: space-between;
  align-items: center; color: var(--text-faint); font-size: .75rem;
}

/* --- Newsletter-Baukasten (Hülle; .gjs-*-Regeln stehen in editor.css) ---------------- */
.editor-shell { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.editor-source textarea { min-height: 22rem; }
.editor-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.token-chip {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); border-radius: 999px;
  padding: .15rem .6rem; font-family: var(--font-mono); font-size: .75rem; cursor: pointer;
}
.token-chip:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }

/* --- Einrichtung der Zwei-Faktor-Anmeldung ---------------------------------- */
.qr-einrichtung { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.75rem; align-items: start; }
@media (max-width: 640px) { .qr-einrichtung { grid-template-columns: 1fr; } }

/* Der Code braucht dunkel auf hell, auch im dunklen Erscheinungsbild - ein
   Lesegerät erwartet es so. Deshalb bleibt die Fläche immer weiß. */
.qr-bild {
  background: #fff; padding: .75rem; border-radius: var(--radius);
  border: 1px solid var(--border); line-height: 0;
  box-shadow: var(--shadow-sm);
}
.qr-bild svg { display: block; width: 12.5rem; height: auto; }
/* Zweiter Schritt der Anmeldung: das Konto steht fest, gefragt ist nur der Code. */
.login-konto {
  margin: 0 0 1.25rem; padding: .6rem .875rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-body); font-size: .875rem;
}
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent); text-decoration: none;
}
.link-btn:hover { color: var(--accent-hover); text-decoration: underline; }
/* --- Hilfe ------------------------------------------------------------------
   Die Schublade fährt von rechts ein und legt sich über den Inhalt. Bewusst
   kein eigenes Fenster: man soll nachschlagen können, ohne die Seite zu
   verlieren, auf der man gerade steht. */
.help-open {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.help-open:hover { color: var(--accent); border-color: var(--accent); }

.help-badge {
  position: absolute; top: -.35rem; right: -.35rem;
  min-width: 1.05rem; height: 1.05rem; padding: 0 .2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--err); color: #fff;
  font-size: .625rem; font-weight: 700; line-height: 1;
}

.help-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 20, 34, .5);
}

.help-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(30rem, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -18px 0 48px rgba(15, 20, 34, .28);
}
.help-drawer[hidden], .help-backdrop[hidden] { display: none; }

.help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.help-head h2 { margin: 0; font-size: 1.0625rem; }
.help-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-muted); cursor: pointer;
}
.help-close:hover { background: var(--surface-2); color: var(--text); }

.help-search { padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); }
.help-search input { width: 100%; }

.help-body { flex: 1; overflow-y: auto; padding: .5rem 1.25rem 2rem; }

.help-section { margin-top: 1.25rem; }
.help-section[hidden] { display: none; }
.help-section h3 {
  margin: 0 0 .5rem; font-size: .6875rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint);
}

.help-article {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); margin-bottom: .5rem;
}
.help-article[hidden] { display: none; }
.help-article > summary {
  display: block; cursor: pointer; padding: .7rem .875rem;
  list-style: none;
}
.help-article > summary::-webkit-details-marker { display: none; }
.help-article > summary:hover .help-article-title { color: var(--accent); }
.help-article[open] { background: var(--surface); border-color: var(--accent); }

.help-article-title { display: block; font-size: .875rem; font-weight: 600; color: var(--text); }
.help-article-teaser { display: block; margin-top: .15rem; font-size: .75rem; color: var(--text-muted); }

.help-article-body { padding: 0 .875rem .875rem; font-size: .8125rem; line-height: 1.6; color: var(--text-body); }

.help-figure {
  margin: 0 0 .9rem; padding: .75rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.help-figure svg { display: block; width: 100%; height: auto; }

.help-steps { margin: 0 0 .75rem; padding-left: 1.15rem; }
.help-steps li { margin-bottom: .4rem; }

.help-notes { margin: 0; padding: 0; list-style: none; }
.help-notes li {
  position: relative; margin-bottom: .4rem; padding-left: .95rem;
  color: var(--text-muted);
}
.help-notes li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: .3rem; height: .3rem; border-radius: 999px; background: var(--accent);
}
.help-article-body code {
  padding: .05rem .3rem; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: .9em;
}
.help-empty { padding: 1.5rem .25rem; color: var(--text-muted); font-size: .8125rem; }

/* Farben der Zeichnungen: folgen dem Erscheinungsbild statt fester Werte. */
.help-figure .hf-flaeche    { fill: var(--surface); stroke: var(--border); }
.help-figure .hf-ton        { fill: var(--surface-2); }
.help-figure .hf-rahmen     { fill: none; stroke: var(--border); }
.help-figure .hf-linie      { fill: var(--border); }
.help-figure .hf-linie-voll { fill: none; stroke: var(--border); stroke-width: 1.4; }
.help-figure .hf-stark      { fill: var(--text-faint); }
.help-figure .hf-akzent     { fill: var(--accent); }
.help-figure .hf-akzent-weich { fill: var(--accent); fill-opacity: .16; stroke: var(--accent); stroke-opacity: .5; }
.help-figure .hf-strich     { stroke: var(--text-faint); }
.help-figure .hf-qr         { fill: #fff; stroke: var(--border); }
.help-figure .hf-qr-punkt   { fill: #12233b; }
.help-figure text           { font-family: inherit; }
.help-figure .hf-text       { fill: #fff; font-size: 11px; font-weight: 600; }
.help-figure .hf-klein      { fill: var(--text-body); font-size: 10px; }
.help-figure .hf-mini       { fill: var(--text-muted); font-size: 8.5px; }
.help-figure .hf-num        { fill: var(--accent); font-size: 12px; font-weight: 700; }
.help-figure .hf-num-hell   { fill: #fff; font-size: 12px; font-weight: 700; }
.help-figure .hf-mono       { fill: var(--text-body); font-size: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.help-figure .hf-mono-mini  { fill: var(--text-muted); font-size: 7.5px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.help-figure .hf-code       { fill: var(--text); font-size: 12px; font-weight: 700; letter-spacing: .06em; }

/* --- Hinweise zur Einrichtung ------------------------------------------------ */
.setup-hint {
  display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
  padding: .8rem 1rem; margin-bottom: .75rem;
  border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--radius); background: var(--surface);
  font-size: .8125rem; line-height: 1.55;
}
.setup-hint .setup-text { flex: 1 1 20rem; }
.setup-hint .setup-text strong { display: block; color: var(--text); }
.setup-hint .setup-text span { color: var(--text-muted); }
.setup-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.setup-error { border-left-color: var(--err); }
.setup-error .setup-text strong { color: var(--err); }
.setup-info  { border-left-color: var(--accent); }

.setup-dismiss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-faint); cursor: pointer;
}
.setup-dismiss:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 640px) {
  .help-drawer { width: 100vw; }
}

/* --- Auswahl der Startvorlage ------------------------------------------------ */
.vorlagen-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .75rem;
}

.vorlage-karte {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.vorlage-karte:hover { border-color: var(--accent); }
.vorlage-karte h3 { margin: 0; font-size: .9375rem; font-weight: 600; }
.vorlage-karte p  { margin: 0; flex: 1 1 auto; }
/* Der Knopf sitzt unten bündig, auch wenn die Beschreibungen verschieden
   lang sind - sonst springt die Reihe. */
.vorlage-karte .btn { align-self: flex-start; margin-top: .3rem; }

/* --- Anleitung in Schritten (Domänen) ---------------------------------------- */
.ds-anleitung { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--text-body); font-size: .875rem; }
.ds-anleitung li { margin-bottom: .5rem; }

/* Mehrere Auswahlfelder in einer Tabellenzelle brauchen weniger Luft. */
.check.small { font-size: .8125rem; margin-bottom: .2rem; }

/* --- Dateiverwaltung --------------------------------------------------------- */
.medien-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.medien-karte {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Feste Höhe mit Schachbrett dahinter: so sieht man bei einem Bild mit
   durchsichtigen Flächen, wo es aufhört. */
.medien-bild {
  display: block; height: 9rem;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%),
    linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.medien-bild img { width: 100%; height: 100%; object-fit: contain; display: block; }

.medien-karte figcaption { padding: .75rem; display: flex; flex-direction: column; gap: .4rem; flex: 1 1 auto; }
.medien-karte figcaption strong {
  font-size: .8125rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.medien-karte input[type=text] { font-size: .8125rem; padding: .35rem .5rem; }
.medien-karte form { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
.medien-aktionen { display: flex; gap: .4rem; flex-wrap: wrap; }

/* --- Protokoll: lange Details aufklappbar ------------------------------------ */
.audit-details {
  margin: .4rem 0 0; padding: .5rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: .75rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  max-width: 34rem;
}
td details summary { cursor: pointer; }

/* --- Support ------------------------------------------------------------------ */
/* Vorgang und Seitenspalte nebeneinander: links der Verlauf, rechts die
   Stellschrauben. Auf schmalen Bildschirmen untereinander. */
.support-spalten { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

/* Der Verlauf wird lang, die Eigenschaften bleiben kurz. Ohne das hier
   scrollt man an Status und Bearbeiter vorbei ins Leere und muss wieder
   hoch, um etwas zu aendern. */
@media (min-width: 1100px) {
  .support-spalten > :last-child {
    position: sticky; top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .support-spalten > :last-child::-webkit-scrollbar { width: 5px; }
  .support-spalten > :last-child::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: 3px;
  }
}

/* Ohne Dateien genuegt ein Satz statt eines Kastens. */
.anhang-leer {
  margin: 0 0 1.25rem; padding: .75rem 1rem;
  border: 1px dashed var(--border); border-radius: var(--radius);
  font-size: .8125rem; color: var(--text-muted);
}
@media (max-width: 1100px) { .support-spalten { grid-template-columns: 1fr; } }

.form-grid-eng { grid-template-columns: 1fr; gap: .9rem; }

/* Die Prioritätsmarke trägt die Dringlichkeit in der Farbe - 1 ist nicht
   dasselbe wie 4, und das soll man im Überfliegen sehen. */
.prio {
  display: inline-grid; place-items: center;
  width: 1.6rem; height: 1.6rem;
  border-radius: 6px;
  font-size: .75rem; font-weight: 700;
  color: #fff;
}
.prio-1 { background: #b3261e; }
.prio-2 { background: #c7641a; }
.prio-3 { background: #5b6577; }
.prio-4 { background: #7c8698; }

.frist-spaet { color: var(--err); font-weight: 600; }

/* --- Journal ------------------------------------------------------------------- */
.journal-eintrag {
  display: flex; gap: .75rem; align-items: flex-start;
  border-left: 3px solid var(--border);
  padding: .6rem 0 .6rem .9rem;
  margin-bottom: .9rem;
}
.journal-inhalt { flex: 1 1 auto; min-width: 0; }
.journal-kopf { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; margin-bottom: .3rem; }
.journal-kopf strong { font-size: .8125rem; }
.journal-mailkopf { margin-bottom: .35rem; word-break: break-word; }

/* --- Bild neben dem Eintrag: zwei Buchstaben -------------------------------
   Kein Hochladen und kein fremder Dienst (Gravatar & Co. wuerden die
   Mailadressen unserer Benutzer an Dritte geben). Die Farbe ergibt sich aus
   dem Namen, damit dieselbe Person immer gleich aussieht, ohne dass das
   irgendwo gespeichert waere. */
.journal-bild {
  flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  user-select: none;
}
.journal-bild.farbe-0 { background: #6d7b8d; }
.journal-bild.farbe-1 { background: #7367f0; }
.journal-bild.farbe-2 { background: #28a0a8; }
.journal-bild.farbe-3 { background: #c2683a; }
.journal-bild.farbe-4 { background: #4a8f5b; }
.journal-bild.farbe-5 { background: #a2558c; }
.journal-bild.farbe-6 { background: #3f7bb8; }
.journal-bild.farbe-7 { background: #8a7230; }

/* Die Art des Eintrags als kleine Marke - "Keine" tritt zurueck, alles was
   nach aussen ging, faellt auf. */
.journal-art {
  font-size: .6875rem; font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.journal-art-reply,
.journal-art-outbound { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
.journal-art-inbound  { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.journal-text { font-size: .9375rem; line-height: 1.6; color: var(--text-body); white-space: pre-wrap; }

/* Antworten an den Melder heben sich ab: sie sind das, was nach aussen ging. */
.journal-reply   { border-left-color: var(--accent); }
.journal-inbound { border-left-color: var(--text-faint); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding-right: .9rem; }
.journal-note    { border-left-color: var(--border); }
.journal-status, .journal-assign, .journal-priority, .journal-system {
  border-left-color: transparent;
  padding-top: .2rem; padding-bottom: .2rem;
  margin-bottom: .5rem;
}
.journal-status .journal-text, .journal-assign .journal-text,
.journal-priority .journal-text, .journal-system .journal-text {
  font-size: .8125rem; color: var(--text-muted);
}

/* --- Bildfeld: Adresse mit Vorschau und Auswahl ------------------------------ */
.bildfeld { display: flex; gap: .75rem; align-items: flex-start; }

/* Feste Größe mit Schachbrett dahinter - wie in der Dateiverwaltung, damit
   man bei einem Bild mit durchsichtigen Flächen sieht, wo es aufhört. */
.bildfeld-vorschau {
  flex: 0 0 auto;
  width: 4.5rem; height: 4.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%),
    linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  overflow: hidden;
}
.bildfeld-vorschau img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* min-width: 0 - sonst sprengt das Eingabefeld den Flexkasten. */
.bildfeld-eingabe { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.bildfeld-knoepfe { display: flex; gap: .4rem; flex-wrap: wrap; }
/* .btn setzt display und schlaegt damit die eingebaute Regel fuer [hidden] -
   der Entfernen-Knopf blieb sonst auch bei leerem Feld stehen. */
.bildfeld-knoepfe .btn[hidden] { display: none; }

/* --- Auswahlfenster ---------------------------------------------------------- */
.medienwahl {
  width: min(56rem, 92vw);
  max-height: 85vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.medienwahl::backdrop { background: rgba(16, 24, 40, .55); }

.medienwahl-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.medienwahl-kopf h2 { margin: 0; font-size: 1rem; }

.medienwahl-leiste {
  display: flex; gap: .6rem; align-items: center;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.medienwahl-leiste input[type=search] { flex: 1 1 auto; min-width: 0; }
/* Das Dateifeld steckt unsichtbar im Knopf - sonst stünde daneben die
   Browserbeschriftung "Keine Datei ausgewählt". */
.medienwahl-upload { flex: 0 0 auto; cursor: pointer; }

.medienwahl-stand { margin: 0; padding: .85rem 1.25rem; font-size: .875rem; color: var(--text-muted); }
.medienwahl-stand.ist-fehler { color: var(--err); }

.medienwahl-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: .75rem;
  padding: 1rem 1.25rem 1.25rem;
  overflow: auto;
}

.medienwahl-karte {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit; font-size: .75rem; text-align: left;
  cursor: pointer;
}
.medienwahl-karte:hover, .medienwahl-karte:focus-visible { border-color: var(--accent); }
.medienwahl-karte img {
  width: 100%; height: 6rem; object-fit: contain; display: block;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.medienwahl-karte span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted);
}

@media (max-width: 40rem) {
  .bildfeld-vorschau { width: 3.5rem; height: 3.5rem; }
  .medienwahl-leiste { flex-wrap: wrap; }
}

/* --- Rollenwahl: mehrere Rollen je Konto ------------------------------------- */
/* Ein Konto kann mehrere Rollen haben, deren Rechte sich addieren. Die
   Erklärung steht neben der Rolle, nicht in einer Tabelle weiter unten -
   wer hier eine Entscheidung trifft, soll sie dort lesen können. */
.rollenwahl {
  margin: 0;
  padding: .9rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.rollenwahl > legend {
  padding: 0 .4rem;
  font-size: .8125rem; font-weight: 600;
  color: var(--text);
}
.rollenwahl .check { margin-bottom: .6rem; align-items: flex-start; }
.rollenwahl .check:last-of-type { margin-bottom: 0; }
/* Beschriftung über der Erklärung, nicht daneben. */
.rollenwahl .check > span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.rollenwahl .check strong { font-weight: 600; color: var(--text); }
.rollenwahl > .hint { margin: .75rem 0 0; }

/* Mehrere Rollenmarken in einer Tabellenzelle sollen umbrechen dürfen. */
td .badge + .badge { margin-left: .25rem; }

/* --- Schlüsselvorrat: Füllstand ---------------------------------------------- */
/* Zahl und Balken zeigen dasselbe. Die Zahl ist die Wahrheit, der Balken
   macht sie auf einen Blick vergleichbar - deshalb trägt er keine eigene
   Beschriftung und ist für Hilfsmittel ausgeblendet. */
.vorrat { font-variant-numeric: tabular-nums; }
.vorrat-gut    { color: var(--ok); }
.vorrat-mittel { color: var(--warn); }
.vorrat-knapp  { color: var(--err); }
.vorrat-leer   { color: var(--err); }

.vorrat-balken {
  display: block; margin-top: .3rem;
  height: 5px; width: 100%;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.vorrat-fuellung { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.vorrat-fuellung.vorrat-mittel { background: var(--warn); }
.vorrat-fuellung.vorrat-knapp,
.vorrat-fuellung.vorrat-leer   { background: var(--err); }

.hinweis-liste { margin: 0; padding-left: 1.3rem; color: var(--text-body); font-size: .9375rem; }
.hinweis-liste li { margin-bottom: .4rem; }

/* --- Support: Fehlertext und Codeblock ------------------------------------- */
.fehlertext { color: var(--err); }

/* Die Zeile der gerade bearbeiteten Navigation hervorheben. */
tr.ist-aktiv > td { background: var(--accent-soft); }

/* --- Wochenansicht der Termine ---------------------------------------------- */
/* Sieben Spalten nebeneinander, auf schmalen Geräten untereinander: eine
   Woche quer gescrollt lesen zu müssen wäre schlimmer als eine Liste. */
.woche {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .6rem;
  margin-bottom: 1rem;
}
@media (max-width: 1100px) { .woche { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .woche { grid-template-columns: 1fr; } }

.wochentag {
  min-height: 9rem;
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex; flex-direction: column; gap: .4rem;
}
.wochentag.ist-heute { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-border); }
/* Geschlossen oder abwesend: zurückgenommen, aber lesbar. */
.wochentag.ist-zu { background: var(--surface-2); }

.wochentag-kopf { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.wochentag-kopf strong { font-size: .9375rem; }
.wochentag-zeiten { margin: 0; line-height: 1.5; }
.wochentag-zu   { margin: 0; font-size: .8125rem; color: var(--text-muted); font-style: italic; }
.wochentag-leer { margin: auto 0 0; font-size: .8125rem; color: var(--text-faint); }

.wochentag-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }

.termin {
  display: block;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  color: var(--text);
  font-size: .8125rem; line-height: 1.35;
}
.termin:hover { background: var(--surface-3); }
.termin strong { display: block; font-variant-numeric: tabular-nums; }
.termin-wer { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.termin-art { display: block; }

/* Bestätigt und wahrgenommen heben sich ab; abgesagte erscheinen gar nicht
   erst in der Woche, sie geben ihre Zeit wieder frei. */
.termin-confirmed { border-left-color: var(--info); background: var(--info-soft); }
.termin-done      { border-left-color: var(--ok);   background: var(--ok-soft); }

/* --- Vorgang: Kopfleiste ------------------------------------------------------
   Status, Priorität, Frist und Bearbeiter standen bisher über die ganze
   Seite verstreut - der Status oben, die Frist unten rechts, die Zuweisung
   in einem Formular dazwischen. Wer einen Vorgang öffnet, will aber zuerst
   genau diese vier sehen. */
/* --- Vorgang: ein Kopf statt drei Balken -------------------------------------
   Vorher: Navigationsleiste mit der Nummer, darunter eine Überschrift mit
   derselben Nummer, darunter ein dritter Kasten mit der Lage. Jetzt ein
   Kasten - Titel oben, Lage und Handgriffe in einer abgesetzten Leiste
   darunter. */
.vorgang-kopf {
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kopf-oben {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1.1rem 1.25rem 1rem;
}
.kopf-titel { min-width: 0; }

.kopf-nummer {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  margin-bottom: .3rem;
}
.kopf-nummer code {
  padding: .1rem .4rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: .75rem; letter-spacing: .02em; color: var(--text-muted);
}
.marke-wieder {
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
  font-size: .6875rem; font-weight: 600;
}

.kopf-titel h1 {
  margin: 0 0 .25rem;
  font-size: 1.375rem; font-weight: 600; letter-spacing: -.015em;
  line-height: 1.3;
}
.kopf-meta { margin: 0; font-size: .8125rem; color: var(--text-muted); }

.kopf-knoepfe { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; }
.kopf-knoepfe .inline-form { margin: 0; }
.knopf-gefahr { color: var(--err); }
.knopf-gefahr:hover { color: var(--err); border-color: var(--err); }

/* Die Leiste trägt die Lage und die zwei Handgriffe des Tages. Sie ist
   abgesetzt, damit sie als Werkzeugleiste gelesen wird - nicht als ein
   weiterer Kasten. */
.kopf-leiste {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .75rem 1rem;
  padding: .7rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.lage { display: flex; flex-wrap: wrap; margin: 0; gap: .5rem 0; }
.lage-feld {
  display: flex; flex-direction: column; gap: .15rem;
  padding: 0 1.1rem;
  border-left: 1px solid var(--border);
}
.lage-feld:first-child { padding-left: 0; border-left: 0; }

.lage dt {
  font-size: .6875rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-faint);
}
/* Eine feste Höhe hält Abzeichen, Ziffer und Text auf einer Linie. */
.lage dd {
  display: flex; align-items: center; gap: .4rem;
  min-height: 1.5rem; margin: 0;
  font-size: .875rem; font-weight: 550; color: var(--text);
}
.lage dd.ist-meiner { color: var(--accent); }
.lage .prio { margin: 0; }

/* Die Frist in Worten, farbig nach Lage. */
.uhr { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.uhr-laeuft { color: var(--ok); }
.uhr-knapp  { color: var(--warn); }
.uhr-spaet  { color: var(--err); }
.uhr-steht  { color: var(--text-muted); font-weight: 550; }

.kopf-griffe { display: flex; flex-wrap: wrap; gap: .4rem; }
.kopf-griffe .inline-form { margin: 0; }

.kopf-alarm {
  margin: 0; padding: .6rem 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--err) 35%, transparent);
  background: color-mix(in srgb, var(--err) 10%, transparent);
  color: var(--err); font-size: .875rem;
}
.kopf-alarm strong { font-weight: 650; }

@media (max-width: 760px) {
  .kopf-oben   { flex-direction: column; }
  .kopf-leiste { flex-direction: column; align-items: stretch; }

  /* Nebeneinander trennen Striche die vier Angaben. Umgebrochen stünde
     der Strich plötzlich links vom ersten Feld der zweiten Zeile und
     schöbe es ein, also hier ein schlichtes Raster. */
  .lage      { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
  .lage-feld { padding: 0; border-left: 0; }
}

/* --- Vorgang: die Seitenspalte -----------------------------------------------
   Fünf gleich schwere Kästen mit Beschriftung über dem Feld wurden zwei
   Bildschirme hoch. Beschriftung neben dem Feld halbiert das, und was man
   selten braucht, liegt zugeklappt bereit. */
.panel-eng { padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel-eng > .panel-head { margin: -1rem -1.1rem .85rem; padding: .7rem 1.1rem; }
.panel-eng > .panel-head h2 { font-size: .9375rem; font-weight: 600; }

.eig { display: flex; flex-direction: column; gap: .6rem; }
.eig-zeile {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: center; gap: .5rem .75rem;
}
.eig-zeile > label {
  margin: 0; font-size: .8125rem; font-weight: 500; color: var(--text-muted);
}
.eig-zeile > select,
.eig-zeile > input,
.eig-zeile > textarea { width: 100%; }

/* Was nicht auf eine Zeile passt, bekommt die volle Breite. */
.eig-zeile.hoch { grid-template-columns: 1fr; gap: .3rem; }

.eig-fuss {
  margin: .25rem 0 0;
  font-size: .75rem; line-height: 1.5; color: var(--text-muted);
}

.fristen { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
.fristen > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
}
.fristen dt { font-size: .8125rem; color: var(--text-muted); }
.fristen dd { margin: 0; font-size: .8125rem; font-weight: 550; text-align: right; }

/* Zugeklappt: Abschluss und die Textfelder des Vorgangs. */
.klapp > summary {
  display: flex; align-items: center; gap: .5rem;
  margin: -1rem -1.1rem; padding: .7rem 1.1rem;
  cursor: pointer; list-style: none;
}
.klapp > summary::-webkit-details-marker { display: none; }
.klapp > summary h2 { margin: 0; font-size: .9375rem; font-weight: 600; }
.klapp > summary::after {
  content: "›"; margin-left: auto;
  color: var(--text-faint); font-size: 1.1rem; line-height: 1;
  transition: transform .15s ease;
}
.klapp[open] > summary::after { transform: rotate(90deg); }
.klapp > summary:hover { background: var(--surface-2); }
.klapp[open] > summary {
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}

/* --- Vorgang: Schreiben -------------------------------------------------------
   Ein Kasten mit drei Reitern statt zweier getrennter Formulare. Ohne
   JavaScript stehen alle drei untereinander - lesbar und benutzbar, nur
   länger. */
.schreiben .reiter {
  display: flex; gap: .25rem;
  margin: -1px -1px 1rem;
  padding: .5rem .5rem 0;
  border-bottom: 1px solid var(--border);
}
.reiter-knopf {
  padding: .5rem .9rem;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none;
  font: inherit; font-size: .875rem; font-weight: 550;
  color: var(--text-muted);
  cursor: pointer;
}
.reiter-knopf:hover { color: var(--text); }
.reiter-knopf:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.reiter-knopf.ist-an {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
  margin-bottom: -1px;
  padding-bottom: calc(.5rem + 1px);
}

.schreiben-was {
  margin: 0 0 .75rem;
  font-size: .875rem;
  color: var(--text-muted);
}

/* --- Vorgang: Speichern bleibt erreichbar ------------------------------------
   Vorher stand der Knopf hinter sechs Kästen. Wer oben etwas änderte,
   scrollte an allem vorbei, um ihn zu finden. */
.speichern-leiste {
  /* Ohne z-index malt der Browser spaetere Geschwister darueber - die
     Leiste klebt dann unten, verschwindet aber hinter dem Inhalt. */
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.speichern-leiste .hint { margin: 0; }

/* Nur für Hilfsmittel: eine Beschriftung, die sichtbar überflüssig wäre. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Empfänger: Spalten einer CSV zuordnen -----------------------------------
   Eine Zeile je Spalte der Datei: wie sie heisst, worauf sie gelegt wird,
   und was drinsteht. Ohne die Beispiele raet man bei Namen wie "field_3". */
.zuordnung-hinweis { margin: 0 0 1rem; }
.zuordnung th[scope="row"] { font-weight: 500; }
.zuordnung th[scope="row"] code {
  display: inline-block; max-width: 100%;
  padding: .1rem .4rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
  overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
}
.zuordnung td select { width: 100%; }
.zuordnung td.small { line-height: 1.5; }
.zuordnung .platzhalter {
  display: block; margin-top: .25rem;
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint);
  font-weight: 400;
}
/* display:block aus der Regel darueber schlaegt sonst das hidden-Attribut:
   der Hinweis stuende dann auch an Spalten, die gar kein eigenes Feld sind. */
.zuordnung .platzhalter[hidden] { display: none; }
