/* fox_orgtool · Hell/Dunkel ueber data-theme auf <html> (auto = prefers-color-scheme)
   Grundwerte "Ruhige Werkbank" (D-62): ein Akzent, neutrale Flaechen, Farbe nur fuer Bedeutung.
   Kontrast der Textfarben auf ihrem Grund >= 4,5:1 (tests/test_ui_tokens.py). */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --bg: #f4f6f8;
  --surface: #ffffff;
  --side: #fbfbfc;
  --fg: #14181f;
  --mut: #5b6472;
  --line: #e3e6eb;
  --line-strong: #c9d0d9;
  --card: #ffffff;
  --hover: #eef1f4;
  --edge-shadow: rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
  --accent: #1f5fd1;
  --accent-fg: #ffffff;
  --acc-soft: #e8f0fd;
  --ok: #1a7f37;
  --bad: #b42318;
  --warn-bg: #fdf1dc;
  --warn-fg: #8a4a06;
  --focus: #1f5fd1;
  --sel: #b45309;
  --match: #1a7f37;
  --drop: #e8f0fd;
}
html[data-theme="dunkel"] {
  --bg: #0e1116;
  --surface: #161a21;
  --side: #11151b;
  --fg: #e6e9ee;
  --mut: #9aa3b2;
  --line: #262c36;
  --line-strong: #3a4352;
  --card: #161a21;
  --hover: #1d222b;
  --edge-shadow: rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  --accent: #8db4ff;
  --accent-fg: #0b1220;
  --acc-soft: #1b2740;
  --ok: #3fb950;
  --bad: #f85149;
  --warn-bg: #3a2a10;
  --warn-fg: #f5b451;
  --focus: #8db4ff;
  --sel: #f0b35c;
  --match: #3fb950;
  --drop: #1b2740;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0e1116;
    --surface: #161a21;
    --side: #11151b;
    --fg: #e6e9ee;
    --mut: #9aa3b2;
    --line: #262c36;
    --line-strong: #3a4352;
    --card: #161a21;
    --hover: #1d222b;
    --edge-shadow: rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
    --accent: #8db4ff;
    --accent-fg: #0b1220;
    --acc-soft: #1b2740;
    --ok: #3fb950;
    --bad: #f85149;
    --warn-bg: #3a2a10;
    --warn-fg: #f5b451;
    --focus: #8db4ff;
    --sel: #f0b35c;
    --match: #3fb950;
    --drop: #1b2740;
  }
}

* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
}
html[data-theme="dunkel"] {
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 0 20px 48px; /* volle Bildschirmbreite */
  font-variant-numeric: tabular-nums;
}

/* Login-Seite (Pflicht-Login wie fox_netmap): zentriertes Panel */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-panel {
  width: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 24px;
}
.login-panel h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.login-panel input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
  transition: top 160ms var(--ease-out);
}
.skip-link:focus-visible {
  top: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Logo (D-44): dekorativ neben dem Namen, feste Groesse gegen Layout-Sprung */
.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}
.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-ver {
  color: var(--mut);
  font-size: 0.85rem;
  margin-left: 6px;
}
.tagline {
  color: var(--mut);
  margin: 0;
  font-size: 0.85rem;
  max-width: 65ch;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
/* Tab-Menue im Header: Umrandung + Beschriftung (wie das Optionen-Menue) */
.tabs-frame {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tabs-frame .menu-label {
  font-weight: 600;
  color: var(--muted, inherit);
}
.top-actions {
  display: flex;
  gap: 8px;
}
/* Einstellungen als Seiten-Panel (Overlay wie fox_netmap), nicht als Vollseite */
#tab-einstellungen.settings-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(440px, 100%);
  z-index: 30;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--card);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  padding: 16px;
}
#tab-einstellungen .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
#tab-einstellungen .panel-head h2 {
  margin: 0;
}

.tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.tab:active {
  transform: scale(0.97);
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (hover: hover) and (pointer: fine) {
  .tab:not(:disabled):hover {
    border-color: var(--accent);
  }
}

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.btn:active {
  transform: scale(0.97);
}
a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
a.btn:not([href]) {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
/* Gesperrte Knoepfe muessen als gesperrt erkennbar sein - auch der Hauptknopf (vorher sah
   ein gesperrtes "Freigeben" aus wie der aktive Hauptknopf). */
.btn:disabled,
.btn.primary:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.btn:disabled:active {
  transform: none;
}
.file-pick {
  display: inline-block;
  pointer-events: none; /* die ganze Dropzone ist der Klickbereich */
}
.btn.icon {
  min-width: 40px;
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover {
    border-color: var(--accent);
  }
  .btn.primary:not(:disabled):hover {
    border-color: var(--accent);
    filter: brightness(1.08);
  }
}
.btn[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

main {
  padding-top: 8px;
}
h1 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 0.8rem;
}
h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin: 1.4rem 0 0.5rem;
}
.hint {
  color: var(--mut);
  max-width: 65ch;
  margin: 0.3rem 0;
}
.status {
  min-height: 1.4em;
  margin: 0.3rem 0;
}
.status.ok {
  color: var(--ok);
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
label.block {
  display: block;
  margin: 10px 0;
}
#editor {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  tab-size: 2;
}
#editor:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
.errors {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--fg);
}
.errors li {
  margin: 2px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.status.err {
  color: var(--bad);
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--drop);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--card);
}
.dropzone p {
  margin: 0;
  flex: 1 1 240px;
}
.dropzone input[type="file"] {
  flex-basis: 100%;
  max-width: 100%;
  color: var(--mut);
}

.table-wrap {
  overflow-x: auto;
}
.history-scroll {
  max-height: 236px; /* ca. 5 Zeilen + Header, Rest per Scroll */
  overflow-y: auto;
}
.history-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--mut);
  font-weight: 600;
  white-space: nowrap;
}
th.num,
td.num {
  text-align: right;
}
td .btn {
  padding: 3px 9px;
  font-size: 0.85rem;
  margin-right: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 0;
}
.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tool-group.grow {
  flex: 1 1 220px;
}
/* Oberes Menu (Optionen-Toolbar): Umrandung + Beschriftung wie die Gruppen */
.toolbar.menu-frame {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.toolbar .menu-label {
  font-weight: 600;
  color: var(--muted, inherit);
}
/* Upload + Schnellauswahl nebeneinander */
.upload-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.upload-row .dropzone {
  flex: 1 1 320px;
}
#quick-pick {
  flex: 0 1 340px;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 10px;
}
#quick-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#quick-list .quick-item {
  width: 100%;
  text-align: left;
  white-space: normal;
}
.tool-group.grow input {
  width: 100%;
}
.tool-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mut);
  padding: 0 4px 0 6px;
  white-space: nowrap;
}
/* Einstellungen-Formular: nach Schwerpunkten gruppiert wie fox_netmap (D-38) */
.st-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  margin: 10px 0;
  padding: 4px 12px 12px;
}
.st-group legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 0 6px;
}
.st-group label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
}
.st-group label > span {
  display: block;
  margin-bottom: 2px;
  color: var(--mut);
}
.st-group input[type="text"],
.st-group input[type="number"],
.st-group input[type="password"],
.st-group select {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  width: 100%;
  max-width: 420px;
}
.st-group input:disabled,
.st-group select:disabled {
  opacity: 0.6;
}
.zoom-group,
.export-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
/* Export zweizeilig: oben DIN-Papierformat (volle Breite), darunter SVG/PDF-Buttons */
.export-group {
  flex-wrap: wrap;
}
.export-group .export-row {
  display: flex;
  gap: 4px;
  flex: 1 1 100%;
  align-items: center;
}
.export-group .export-row .inline.grow,
.export-group .export-row select {
  width: 100%;
}
select,
input[type="search"] {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  font: inherit;
}

.viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .viewer-grid {
    grid-template-columns: 1fr;
  }
}
.svg-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: auto;
  height: 78vh;
  min-height: 320px;
}
#svg-zoom {
  transform-origin: 0 0;
  min-width: 100%;
}
#svg-zoom svg {
  display: block;
  width: 100%;
  height: auto;
}
.search-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 30vh;
  overflow: auto;
  display: none;
}
.search-results:has(li) {
  display: block;
}
.search-hit {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg);
  font: inherit;
}
.search-hit:hover,
.search-hit:focus-visible {
  background: var(--card);
  outline: 2px solid var(--ot-accent);
  outline-offset: -2px;
}
.search-fields {
  color: var(--mut);
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 12px 14px;
}
.detail h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 8px 0;
}
.detail dt {
  color: var(--mut);
}
.detail dd {
  margin: 0;
}
.detail ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.badge {
  display: inline-block;
  border: 1px solid currentcolor;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 0.78rem;
  margin-left: 6px;
}
.badge.ok {
  color: var(--ok);
}
.badge.warn {
  color: var(--sel);
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 10px;
  display: flex;
  gap: 12px;
  color: var(--mut);
  font-size: 0.85rem;
}
.mut {
  color: var(--mut);
}
.chips {
.chip.mark-neu{background:#dcfce7;color:#166534}
.chip.mark-entfernt{background:#fee2e2;color:#991b1b}
.chip.mark-verschoben{background:#fef3c7;color:#92400e}
.chip.mark-umbenannt,.chip.mark-typ_geaendert,.chip.mark-posten_geaendert{background:#dbeafe;color:#1e40af}
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.85rem;
  background: var(--card);
}
.chip.ok {
  color: var(--ok);
  border-color: var(--ok);
}
.chip.warn {
  color: var(--sel);
  border-color: var(--sel);
}
.chip.mut {
  color: var(--mut);
}

/* SVG-Karte (Farben kommen aus der eingebetteten SVG-CSS, hier nur Interaktion) */
#svg-zoom .ot-node {
  transition: opacity 160ms var(--ease-out);
}
#svg-zoom .ot-dim {
  opacity: 0.25;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Bedienung Teil 2 (D-56): aktuelles Organigramm, Karte nach oben ------------------- */
.docbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.docbar-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 420px;
  min-width: 0;
}
.docbar-pick select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
/* Sobald es Organigramme gibt, schrumpft der Upload auf eine Zeile: die Karte rueckt nach oben */
.has-docs .upload-row .dropzone {
  padding: 6px 12px;
  border-width: 1px;
}
.has-docs #drop-hint {
  display: none;
}
.has-docs > h1 {
  margin-bottom: 8px;
}
.first-steps {
  flex: 0 1 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.first-steps p {
  margin: 0;
}
.first-steps[hidden] {
  display: none;
}
/* Optionen in einer Zeile, wenn der Platz reicht; Export dann ebenfalls einzeilig. Darunter
   bricht die Leiste um (bei 1366 px ragte sie sonst rechts hinaus) */
@media (min-width: 1500px) {
  .toolbar.menu-frame {
    flex-wrap: nowrap;
  }
}
@media (min-width: 900px) {
  .export-group {
    flex-wrap: nowrap;
  }
  .export-group .export-row {
    flex: 0 0 auto;
  }
  .export-group .export-row .inline.grow,
  .export-group .export-row select {
    width: auto;
  }
}
/* Hinweis auf verdeckte Teile der Karte: Schatten am Rand (Hinweis zusaetzlich als Text) */
.map-frame {
  position: relative;
}
.map-edge {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}
.edge-left,
.edge-right {
  top: 1px;
  bottom: 1px;
  width: 28px;
}
.edge-top,
.edge-bottom {
  left: 1px;
  right: 1px;
  height: 28px;
}
.edge-left {
  left: 1px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(to right, var(--edge-shadow), transparent);
}
.edge-right {
  right: 1px;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(to left, var(--edge-shadow), transparent);
}
.edge-top {
  top: 1px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(to bottom, var(--edge-shadow), transparent);
}
.edge-bottom {
  bottom: 1px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(to top, var(--edge-shadow), transparent);
}
.more-left .edge-left,
.more-right .edge-right,
.more-top .edge-top,
.more-bottom .edge-bottom {
  opacity: 1;
}
.map-more:empty {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .map-edge {
    transition: none;
  }
}
/* Pseudonymisieren als nummerierte Schritte */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 820px;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 10px 12px 10px 52px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-fg);
}
.steps h2 {
  margin: 2px 0 4px;
  font-size: 1.05rem;
}
.step-value {
  font-weight: 600;
  margin: 4px 0 0;
}
.docbar[hidden] {
  display: none;
}
#zoom-reset {
  white-space: nowrap;
  min-width: 64px;
}
.toolbar .tool-group.grow input {
  min-width: 140px;
}
/* Mit Organigrammen: Ueberschrift und Kartentitel nur fuer Screenreader (Titel und Status stehen
   in der Leiste oben), leere Statuszeile ohne Abstand - die Karte beginnt deutlich weiter oben */
.has-docs > h1,
.has-docs #viewer-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.has-docs #upload-status:empty {
  display: none;
}
.has-docs .toolbar.menu-frame {
  margin-top: 8px;
}
.has-docs #viewer .hint {
  margin: 6px 0;
}
.steps .status:empty {
  display: none;
}
.has-docs .toolbar.menu-frame {
  max-width: 100%;
}

/* --- W13: Pruefschritt im Tab Erstellen (D-58) ------------------------------------------- */
.import-reasons {
  font-size: 0.8rem;
  color: var(--mut);
  margin-top: 2px;
  max-width: 28ch;
}
.import-summary {
  font-weight: 600;
}
.import-meta input[type="text"] {
  min-width: 220px;
}

/* --- W15: Assistent im Tab Erstellen (D-59) ------------------------------------------------ */
.create-modes {
  margin-top: 4px;
}
.wiz-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  counter-reset: wiz;
  padding: 0;
  margin: 12px 0;
}
.wiz-steps li {
  counter-increment: wiz;
  color: var(--mut);
}
.wiz-steps li::before {
  content: counter(wiz) ". ";
}
.wiz-steps li.current {
  color: var(--fg);
  font-weight: 700;
}
.wiz-steps li.done {
  color: var(--fg);
}
.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.wiz-errors {
  border: 1px solid var(--bad);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 6px 12px;
  margin: 8px 0;
  max-width: 70ch;
}
.wiz-errors p {
  margin: 4px 0;
  font-weight: 700;
}
#wiz-form [aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad);
}
.wiz-step:focus {
  outline: none;
}
.wiz-level {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.wiz-level .hint {
  margin: 0;
}
.wiz-tree,
.wiz-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.wiz-tree ul {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.wiz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}
.wiz-tree input[type="text"],
.wiz-tree select,
.wiz-level select,
.wiz-post input,
.wiz-post select,
.wiz-contact input {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}
.wiz-tree input[type="text"] {
  min-width: 220px;
}
.wiz-tree input.wiz-code {
  min-width: 0;
  width: 9ch;
}
.wiz-unit {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  margin: 6px 0;
  background: var(--bg);
}
.wiz-unit summary {
  cursor: pointer;
  padding: 4px 0;
}
.st-group .wiz-post label,
.st-group .wiz-contact label {
  display: inline-block;
  margin: 4px 8px 4px 0;
  vertical-align: bottom;
}
.wiz-post {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 4px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}
.wiz-contact {
  border: 0;
  padding: 0;
  margin: 6px 0;
}
.wiz-contact legend {
  font-weight: 600;
  font-size: 13px;
  padding: 0;
}
.wiz-findings {
  padding-left: 18px;
  max-width: 80ch;
}
.wiz-findings .badge {
  margin-left: 0;
}
.wiz-preview {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.wiz-preview svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
@media (prefers-reduced-motion: no-preference) {
  .wiz-step:not([hidden]) {
    animation: wiz-in 180ms var(--ease-out);
  }
  @keyframes wiz-in {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
  }
}
/* hidden muss auch gegen ".st-group label { display: block }" gewinnen */
#create-wiz [hidden] {
  display: none !important;
}

/* Import: Posten mit Person als kurze Liste (D-60) */
.import-posts {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
}
.import-posts li {
  margin: 1px 0;
}

/* ==========================================================================================
   Design "Ruhige Werkbank" (D-62): App-Huelle, Kopfzeile, schwebende Ansichtsleiste,
   Detailansicht nur bei Auswahl, Bausteine. Steht am Ende und ueberschreibt aeltere Regeln.
   Bewegung 150-200 ms ease-out, kein Federn; bei "Bewegung reduzieren" nur Blende.
   ========================================================================================== */
body {
  padding: 0;
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
.app {
  display: flex;
  min-height: 100vh;
}
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
main {
  padding: 20px 24px 48px;
}
h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 16px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
}

/* --- Seitenleiste ---------------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px;
  background: var(--side);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar .brand-ver {
  margin: 0;
  font-size: 12px;
  color: var(--mut);
}
.sidebar .tabs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-wrap: nowrap;
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
  padding: 0 10px 6px;
}
.sidebar .tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.sidebar .tab::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: transparent;
  flex: 0 0 6px;
}
.sidebar .tab:hover {
  background: var(--hover);
}
.sidebar .tab.active {
  background: var(--acc-soft);
  color: var(--accent);
  font-weight: 600;
  border: 0;
}
.sidebar .tab.active::before {
  background: var(--accent);
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}
.sidebar-foot .hint {
  font-size: 12px;
}
.sidebar .theme-btn,
.sidebar .theme-btn[aria-pressed="true"] {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0 4px;
  background: transparent;
  color: var(--fg);
  border-color: transparent;
}
.sidebar .theme-btn:hover {
  background: var(--hover);
}

/* --- Kopfzeile ------------------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar .docbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 8px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  max-width: min(560px, 100%);
}
.appbar .docbar[hidden] {
  display: none;
}
.appbar .docbar-pick {
  display: flex;
  min-width: 0;
}
.appbar .docbar select {
  min-height: 36px;
  max-width: 440px;
  border: 0;
  background: transparent;
  font-weight: 600;
}
.appsearch {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  min-height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--mut);
}
.appsearch:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.appsearch input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
}
.appsearch input[type="search"]:focus-visible {
  outline: none;
}
.kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--mut);
  white-space: nowrap;
}
.search-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(520px, 92vw);
  z-index: 30;
  display: none;
  max-height: 60vh;
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  color: var(--fg);
}
.appsearch:focus-within .search-pop:has(#search-count:not(:empty)),
.search-pop:has(li):hover {
  display: block;
  animation: pop-in 150ms var(--ease-out);
}
.search-pop .hint {
  margin: 2px 6px 6px;
  font-size: 12px;
}
.search-pop .search-results {
  max-height: none;
  margin: 0;
}
.search-pop .search-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
}
.search-pop .search-fields {
  font-size: 12px;
  color: var(--mut);
}
.export-menu {
  position: relative;
}
.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: pop-in 150ms var(--ease-out);
}
.popover[hidden] {
  display: none;
}
.popover .inline {
  justify-content: space-between;
}

/* --- Bausteine --------------------------------------------------------------------------- */
.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    transform 150ms var(--ease-out);
}
.btn:not(:disabled):hover {
  background: var(--hover);
}
.btn:not(:disabled):active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.btn.primary:not(:disabled):hover {
  background: var(--accent);
  filter: brightness(0.94);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:not(:disabled):hover {
  background: var(--hover);
}
.btn.icon {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}
.btn[aria-pressed="true"] {
  background: var(--acc-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
select,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"] {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
}
.badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-color: transparent;
}
.table-wrap,
.history-scroll {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mut);
}

/* --- Organigramm: Karte zuerst --------------------------------------------------------- */
.has-docs .upload-row {
  display: none;
}
.upload-row {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 24px auto;
}
.upload-row .dropzone {
  min-height: 200px;
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
}
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 3px dashed var(--accent);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  pointer-events: none;
}
.drop-overlay[hidden] {
  display: none;
}
#viewer .viewer-grid {
  position: relative;
  display: block;
}
.map-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.map-frame .svg-wrap {
  border: 0;
  border-radius: 0;
  height: calc(100vh - 150px);
  min-height: 480px;
}
.map-more {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--mut);
  font-size: 12px;
  max-width: 60%;
}
.map-toolbar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.map-toolbar .tool-group {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  gap: 2px;
}
.map-toolbar select {
  min-height: 36px;
  border-color: transparent;
  background-color: transparent;
}
.map-toolbar select:hover {
  background-color: var(--hover);
}
/* offene Detailansicht: Ansichtsleiste rueckt nach links, damit sie frei bleibt */
.viewer-grid:has(#detail:not([hidden])) .map-toolbar {
  left: calc(50% - 176px);
}
.tool-sep {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}
#detail.detail {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  width: 340px;
  max-width: calc(100% - 24px);
  overflow: auto;
  margin: 0;
  padding: 20px 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: panel-in 180ms var(--ease-out);
}
#detail.detail[hidden] {
  display: none;
}
#detail h3 {
  margin: 0 40px 12px 0;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
#detail h4 {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}
.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #detail.detail,
  .popover,
  .search-pop {
    animation-name: fade-in;
  }
  .btn:not(:disabled):active {
    transform: none;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* --- Schmale Fenster: Navigation oben, Detail unter der Karte ---------------------------- */
@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    position: static;
    height: auto;
    flex: 0 0 auto;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .nav-section {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-group {
    padding: 0 4px 0 0;
  }
  .sidebar .tab {
    width: auto;
  }
  .sidebar-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
  }
  .appbar {
    position: static;
    padding: 10px 16px;
  }
  .appsearch {
    margin-left: 0;
    width: 100%;
  }
  main {
    padding: 16px;
  }
  #detail.detail {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 12px;
    box-shadow: none;
  }
}

/* Design „Ruhige Werkbank“, Welle 2 (D-63): Bericht und Prüfschritt */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.page-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-title h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 0;
  font-size: 13px;
  color: var(--mut);
}
.kpis {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.kpi-label,
.kpi-note {
  font-size: 13px;
  color: var(--mut);
}
.kpi-note {
  font-size: 12px;
}
.kpi-value {
  font-size: 28px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.report-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.panel h2 {
  margin: 0;
  font-size: 17px;
}
.report-findings {
  flex: 999 1 520px;
}
.report-levels {
  flex: 1 1 300px;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.count {
  color: var(--mut);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.seg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.seg-chip:hover {
  background: var(--hover);
}
.seg-chip[aria-pressed="true"] {
  background: var(--acc-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}
.seg-chip:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.finding-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--warn-fg);
}
.sev-dot.warnung {
  background: var(--bad);
}
.finding-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.finding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
}
.finding-text {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.finding-text strong {
  font-size: 14px;
}
.finding-text span {
  font-size: 13px;
  color: var(--mut);
}
.code-chip {
  min-width: 44px;
  box-sizing: border-box;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--hover);
  color: var(--fg);
}
.levels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.level-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.level-n {
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.level-bar {
  height: 8px;
  margin-top: 6px;
  border-radius: 4px;
  background: var(--hover);
}
.level-bar > div {
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
}
.metrics-all summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--mut);
}
.metrics-all[open] summary {
  margin-bottom: 8px;
}
.import-progress {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 12px 0;
  padding: 16px 20px;
}
.import-progress-main {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.import-progress .level-bar {
  margin-top: 0;
}
#import-bar-fill {
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  transition: width 200ms var(--ease-out);
}
.import-progress-text {
  font-size: 13px;
  color: var(--mut);
}
.import-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
}
.import-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.import-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.import-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    border-color 150ms var(--ease-out),
    opacity 150ms var(--ease-out);
}
.import-card.import-unsure {
  border-color: var(--warn-fg);
}
.import-card.is-confirmed {
  border-color: var(--ok);
}
.import-card.is-excluded {
  border-style: dashed;
  border-color: var(--line-strong);
}
.import-card.is-excluded .import-fields,
.import-card.is-excluded .import-posts {
  opacity: 0.6;
}
.import-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.import-card-title {
  font-size: 15px;
}
.import-card .import-reasons {
  max-width: none;
  margin-top: 0;
  font-size: 13px;
  color: var(--mut);
}
.import-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.import-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--mut);
}
.import-fields input,
.import-fields select {
  min-height: 38px;
  font-size: 14px;
  color: var(--fg);
}
.import-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.import-card .import-posts {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--mut);
}
.import-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.import-sure {
  font-size: 13px;
  color: var(--mut);
}
.import-confirm[aria-pressed="true"] {
  background: var(--acc-soft);
  color: var(--accent);
  border-color: transparent;
}
.import-foot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px -4px 0;
  padding: 14px 16px;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}
.import-check {
  margin: 0;
  flex: 1 1 260px;
  font-size: 14px;
  color: var(--ok);
}
.import-check.is-open {
  color: var(--fg);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  #import-bar-fill,
  .import-card,
  .seg-chip {
    transition: none;
  }
}
