/* =============================================================
   WohnBau-Vision — Design-System
   Orange (Marke/Dach) + Navy (Schrift/Flaechen), helle Papier-Flaeche.
   Konsistent mit dem Klickprototyp; hier als reines CSS statt Tailwind,
   damit die App ohne Build-Step auf jedem Root-Server laeuft.
   ============================================================= */

:root {
  --navy: #17233F;
  --navy-deep: #0D1526;
  --orange: #E8791E;
  --orange-deep: #C8630F;
  --orange-soft: #FBEADA;
  --paper: #F7F8FA;
  --card: #FFFFFF;
  --ink: #1B2333;
  --ink-soft: #707888;
  --line: #E6E8EE;
  --green: #3D8459;
  --green-soft: #E8F2EB;
  --red: #B34632;
  --red-soft: #F6E9E5;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

.font-display { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.font-ui { font-family: 'Public Sans', system-ui, sans-serif; }

.eyebrow {
  font-family: 'Public Sans', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--orange-deep);
  text-transform: none;
}

/* ---------------- Layout ---------------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; position: relative; }

.sidebar {
  width: 288px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--card);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px; border-bottom: 1px solid var(--line);
}
.sidebar-brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; color: var(--ink); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink); text-decoration: none;
  border: none; background: none; cursor: pointer; text-align: left;
}
.sidebar-link:hover { background: var(--paper); }
.sidebar-link.active { background: var(--orange-soft); font-weight: 600; }
.sidebar-link.nested { padding-left: 24px; color: var(--ink-soft); }
.sidebar-link.nested:hover { color: var(--ink); }
.sidebar-footer { border-top: 1px solid var(--line); padding: 16px; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px); padding: 12px 20px; position: sticky; top: 0; z-index: 10;
}
.topbar-crumb { font-size: 14px; color: var(--ink-soft); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--card); cursor: pointer; text-decoration: none;
  position: relative;
}
.icon-btn:hover { background: var(--paper); }

.badge-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-outline { background: var(--card); border-color: var(--line); color: var(--ink-soft); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange-deep); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-danger { background: var(--red); color: #fff; }

.content-scroll { flex: 1; overflow-y: auto; }

.container-md { max-width: 56rem; margin: 0 auto; padding: 20px; }
.container-sm { max-width: 48rem; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl);
  overflow: clip;
}
.card-pad { padding: 20px; }
.card-hover { transition: box-shadow .3s; }
.card-hover:hover { box-shadow: 0 12px 30px -12px rgba(23,35,63,.15); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--card); padding: 20px; }
.stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ink); }
.stat-label { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 500;
}
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-orange { background: var(--orange-soft); color: var(--orange-deep); }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--paper); }

.form-label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; color: var(--ink); background: var(--card);
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,121,30,.15);
}
.form-group { margin-bottom: 16px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 4px; }

.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info { background: var(--orange-soft); color: var(--orange-deep); }

.folder-tree { padding: 16px; }
.folder-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--ink); background: none; border: none; cursor: pointer; text-align: left;
}
.folder-btn:hover { background: var(--paper); }
.chapter-list { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.chapter-link {
  display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px;
  color: var(--ink-soft); text-decoration: none;
}
.chapter-link:hover { background: var(--paper); color: var(--ink); }
.chapter-link.active { background: var(--orange-soft); color: var(--ink); font-weight: 600; }

.prose h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.1rem; margin-top: 1.5em; }
.prose p { line-height: 1.8; font-size: 15px; margin: 0 0 1em; }

.hero-tile {
  position: relative; border-radius: var(--radius-xl); overflow: clip;
  aspect-ratio: 4/5; display: block; text-decoration: none;
}
.hero-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.hero-tile:hover img { transform: scale(1.05); }
.hero-tile-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.05) 60%, transparent); }
.hero-tile-label {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  background: var(--navy); color: var(--orange); text-align: center;
  border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 600;
}

.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 500;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,21,38,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-box { width: 100%; max-width: 32rem; background: var(--card); border-radius: var(--radius-xl); padding: 24px; }

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(0,0,0,.13); border-radius: 99px; }

@media (max-width: 900px) {
  .sidebar { position: absolute; inset-y: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 20; }
}

/* =============================================================
   Elementbaum-Oberfläche (orgavision-Struktur im WohnBau-Design)
   ============================================================= */
:root {
  --navy-soft: #E8EBF2;
  --gray-soft: #EEF0F4;
  --shadow-sm: 0 1px 2px rgba(23,35,63,.06);
  --shadow-md: 0 1px 2px rgba(23,35,63,.05), 0 12px 32px -16px rgba(23,35,63,.18);
}
.muted { color: var(--ink-soft); }
.w-full { width: 100%; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.inline-form { display: inline; margin: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.display-title { overflow-wrap: anywhere; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.15; margin: 6px 0 10px; }
.section-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.section-title a { text-decoration: none; }
.eyebrow { text-transform: uppercase; }

.pill-navy { background: var(--navy-soft); color: var(--navy); }
.pill-gray { background: var(--gray-soft); color: var(--ink-soft); }
.btn { min-height: 36px; transition: background .2s, border-color .2s, color .2s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 32px; }
.btn-danger-outline { background: var(--card); border-color: rgba(179,70,50,.35); color: var(--red); }
.btn-danger-outline:hover { background: var(--red-soft); }
.icon-btn { transition: background .2s, color .2s, border-color .2s; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn:hover { color: var(--orange-deep); border-color: rgba(232,121,30,.4); }

/* ---------------- Seitenleiste ---------------- */
.sidebar { width: 320px; }
.sidebar-brand { text-decoration: none; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 24px; }
.sidebar-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 0 10px; margin: 4px 4px 12px; color: var(--ink-soft); }
.sidebar-search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,121,30,.15); }
.sidebar-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; padding: 10px 0; color: var(--ink); }
.sidebar-search kbd { font-family: inherit; font-size: 10px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--card); }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 40px; border-radius: 9px; font-size: 14px; color: var(--ink); text-decoration: none; transition: background .2s; }
.nav-item svg { color: var(--ink-soft); flex-shrink: 0; transition: color .2s; }
.nav-item:hover { background: var(--paper); }
.nav-item:hover svg { color: var(--orange-deep); }
.nav-item.is-active { background: var(--orange-soft); font-weight: 600; }
.nav-item.is-active svg { color: var(--orange-deep); }
.nav-emergency, .nav-emergency svg { color: var(--red) !important; }
.nav-emergency { font-weight: 600; }
.nav-emergency:hover { background: var(--red-soft); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-heading { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 10px 6px; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 13px; padding-left: 8px; border-left: 1px solid var(--line); }
.tree summary { list-style: none; display: flex; align-items: center; cursor: pointer; border-radius: 8px; }
.tree summary::-webkit-details-marker { display: none; }
.tree-caret { width: 18px; height: 28px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.tree-caret::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.tree details[open] > summary .tree-caret::before { transform: rotate(45deg); }
.tree-leaf { padding-left: 18px; }
.tree-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; font-size: 13.5px; line-height: 1.3; color: var(--ink); text-decoration: none; }
.tree-link .ico { flex-shrink: 0; color: var(--ink-soft); }
.tree-link[data-type="folder"] .ico { color: var(--orange); }
.tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-link:hover { background: var(--paper); }
.tree-link.is-active { background: var(--orange-soft); font-weight: 600; }
.tree-link.is-muted { opacity: .6; }
.tree-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--orange); flex-shrink: 0; margin-left: auto; }

.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--ink-soft); }
.avatar-img { border-radius: 99px; object-fit: cover; flex-shrink: 0; background: var(--paper); }

.topbar { gap: 12px; justify-content: flex-start; }
.topbar-crumb { flex: 1; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.flash-wrap { max-width: 72rem; margin: 0 auto; padding: 16px 20px 0; }

/* ---------------- Element-Seite ---------------- */
.node-page { max-width: 80rem; margin: 0 auto; padding: 20px 20px 64px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange-deep); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }
.node-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.node-main { min-width: 0; }

.folder-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(135deg, #fff 0%, #fff 55%, var(--orange-soft) 140%); box-shadow: var(--shadow-sm); }
.folder-head .display-title { margin-bottom: 4px; }
.folder-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.new-menu { display: flex; gap: 8px; align-items: center; }
.new-menu details { position: relative; }
.new-menu summary { list-style: none; cursor: pointer; }
.new-menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; }
.menu-pop a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--ink); }
.menu-pop a:hover { background: var(--orange-soft); }
.menu-pop .ico { color: var(--orange-deep); }

.reading-flow { display: flex; flex-direction: column; gap: 14px; }
.el-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: clip; box-shadow: var(--shadow-sm); transition: box-shadow .3s, border-color .3s, transform .3s; scroll-margin-top: 80px; }
.el-card:hover { box-shadow: var(--shadow-md); border-color: #D9DDE6; }
.el-card:target { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,121,30,.18); }
.el-card.needs-ack { border-color: rgba(232,121,30,.55); }
.el-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.el-title-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.el-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-deep); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .25s, color .25s; }
.el-card:hover .el-icon, .folder-row:hover .el-icon, .mini-card:hover .el-icon { background: var(--orange); color: #fff; }
.el-title { flex: 1 1 260px; min-width: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.12rem; font-weight: 700; margin: 0; color: var(--ink); line-height: 1.3; }
.is-single .el-title { font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem); }
.el-title a { text-decoration: none; }
.el-title a:hover { color: var(--orange-deep); }
.el-actions { display: flex; gap: 4px; flex-shrink: 0; opacity: .75; transition: opacity .2s; }
.el-card:hover .el-actions, .el-card:focus-within .el-actions { opacity: 1; }
.el-body { padding: 14px 20px 20px; }
.el-note { margin: 12px 20px 0; }

.folder-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: box-shadow .25s, border-color .25s, transform .25s; scroll-margin-top: 80px; }
.folder-row:hover { border-color: rgba(232,121,30,.45); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.folder-row-title { flex: 1; min-width: 0; font-weight: 600; }
.folder-row-arrow { color: var(--ink-soft); transition: transform .25s, color .25s; }
.folder-row:hover .folder-row-arrow { transform: translateX(3px); color: var(--orange-deep); }
.folder-row.is-broken { opacity: .7; }
.folder-link { font-weight: 600; color: var(--orange-deep); text-decoration: none; }

/* Inhalte aus orgavision: Tabellen, Hinweise, Bilder */
.prose { color: var(--ink); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.3; margin: 1.4em 0 .5em; color: var(--ink); }
.prose h1 { font-size: 1.5rem; } .prose h2 { font-size: 1.25rem; } .prose h3 { font-size: 1.08rem; } .prose h4 { font-size: 1rem; }
.prose p { margin: 0 0 .8em; line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .2em 0; }
.prose a { color: var(--navy); text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { color: var(--orange-deep); }
.prose img { height: auto; border-radius: 8px; }
.prose table { border-collapse: collapse; max-width: 100%; margin: 0 0 1em; font-size: 14px; display: block; overflow-x: auto; }
.prose td, .prose th { padding: 6px 8px; vertical-align: top; }
.prose blockquote { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--orange); background: var(--orange-soft); border-radius: 0 10px 10px 0; }
.prose details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 1em; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

.wbv-embed { position: relative; aspect-ratio: 16 / 10; margin: 0 0 1em; border-radius: 12px; overflow: clip; background: var(--navy); }
.wbv-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-consent { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; border: 0; cursor: pointer; text-align: center; color: #fff; font: inherit; background: radial-gradient(circle at 30% 20%, rgba(232,121,30,.35), transparent 60%), var(--navy); }
.embed-consent strong { font-size: 16px; }
.embed-consent span { font-size: 13px; opacity: .8; max-width: 420px; }
.embed-consent::before { content: '▶'; width: 52px; height: 52px; border-radius: 99px; background: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 18px; transition: transform .2s; }
.embed-consent:hover::before { transform: scale(1.08); }

/* Dateien */
.file-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.file-badge { width: 46px; height: 46px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-meta { display: flex; flex-direction: column; flex: 1; min-width: 180px; font-size: 13px; }
.file-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.file-btns { display: flex; gap: 8px; }
.file-preview { display: block; margin-bottom: 12px; }
.file-preview img { max-height: 320px; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(#f2f3f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.file-video { width: 100%; border-radius: 12px; margin-bottom: 12px; background: #000; }
.pdf-frame { width: 100%; height: 78vh; min-height: 480px; border: 1px solid var(--line); border-radius: 12px; margin-top: 14px; background: var(--paper); }

/* Rollen & Personen */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 99px; background: var(--navy-soft); color: var(--navy); font-size: 13px; font-weight: 500; text-decoration: none; transition: background .2s, color .2s; }
.chip:hover { background: var(--navy); color: #fff; }
.role-details summary { cursor: pointer; color: var(--orange-deep); font-weight: 600; font-size: 14px; padding: 6px 0; min-height: 32px; }
.role-details[open] summary { margin-bottom: 10px; }
.person { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: box-shadow .25s, border-color .25s, transform .25s; }
.person-card:hover { border-color: rgba(232,121,30,.45); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.person-photo { width: 52px; height: 52px; border-radius: 99px; object-fit: cover; flex-shrink: 0; background: var(--paper); }
.person-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-weight: 700; }
.person-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.person-text strong { font-size: 14px; }

/* Prozesse & Organigramme */
.bpmn-box { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfd; overflow: hidden; }
.bpmn-box .bjs-powered-by { display: none !important; }
.bpmn-tools { display: flex; gap: 8px; margin-top: 10px; }
.organigram { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.organigram img { width: 100%; height: auto; }

/* Kenntnisnahme */
.ack-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 20px 20px; padding: 12px 14px; border-radius: 12px; background: var(--orange-soft); color: var(--ink); font-size: 14px; }
.ack-box.is-done { background: var(--green-soft); color: var(--green); }
.ack-box form { margin: 0; }
.ack-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.ack-row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; color: var(--ink); }
.ack-row-actions { display: flex; gap: 8px; }
.ack-row-actions form { margin: 0; }
.progress { display: block; height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--green)); border-radius: 99px; }
.row-progress { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.row-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
a.list-row { text-decoration: none; color: var(--ink); }

/* Änderungsentwürfe */
.draft-box { border: 2px dashed rgba(232,121,30,.55); border-radius: var(--radius-xl); padding: 16px 20px; margin-bottom: 16px; background: #FFFBF6; }
.draft-box header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.draft-preview { max-height: 420px; overflow: auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.draft-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.draft-actions form { margin: 0; }
.link-note { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; }
.link-note a { color: var(--orange-deep); }

/* Element-Information */
.node-info { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.info-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 4px 2px 0; }
.info-list { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 16px; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--ink-soft); }
.info-list dd { margin: 0; text-align: right; color: var(--ink); }
.info-block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.info-block h3 { font-size: 13px; font-weight: 700; margin: 0; }
.info-block p { margin: 0; }
.info-block.review { border-color: rgba(232,121,30,.55); background: #FFFBF6; }
.info-block summary { cursor: pointer; color: var(--ink-soft); padding: 4px 0; }
.info-block .form-select { padding: 8px 10px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.plain-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plain-list a { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.plain-list a:hover { color: var(--orange-deep); }

/* Formulare */
.form-card { display: flex; flex-direction: column; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 8px; background: var(--paper); position: sticky; top: 0; z-index: 2; }
.editor-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 9px; min-height: 32px; min-width: 32px; font-size: 13px; cursor: pointer; color: var(--ink); }
.editor-toolbar button:hover { border-color: var(--orange); color: var(--orange-deep); }
.editor-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor-area { min-height: 280px; max-height: 70vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 14px 16px; background: #fff; outline: none; }
.editor-area:focus { border-color: var(--orange); }

/* Startseite */
.home { max-width: 80rem; margin: 0 auto; padding: 24px 20px 64px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: end; padding: 28px; margin-bottom: 18px; border-radius: 24px; color: #fff; background: radial-gradient(circle at 85% 0%, rgba(232,121,30,.45), transparent 55%), linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); position: relative; overflow: clip; }
.home-hero::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.home-hero > * { position: relative; z-index: 1; }
.home-hero .eyebrow { color: #F5B47A; }
.home-hero .display-title { color: #fff; }
.hero-search { display: flex; gap: 8px; margin-top: 14px; }
.hero-search input { flex: 1; min-width: 0; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); padding: 0 16px; font: inherit; font-size: 15px; }
.home-hero .hero-search input { border-color: transparent; }
.home-hero .hero-search .btn-primary { background: var(--orange); }
.home-hero .hero-search .btn-primary:hover { background: var(--orange-deep); }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.hero-stats div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 14px 16px; backdrop-filter: blur(6px); }
.hero-stats dt { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.6rem; font-weight: 800; }
.hero-stats dd { margin: 0; font-size: 13px; opacity: .75; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 16px; text-decoration: none; margin-bottom: 12px; transition: transform .2s, box-shadow .2s; }
.notice:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.notice span { display: flex; flex-direction: column; gap: 2px; }
.notice small { font-size: 13px; opacity: .8; }
.notice-green { background: var(--green-soft); color: var(--green); }
.notice-orange { background: var(--orange-soft); color: var(--orange-deep); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 18px; }
.home-side { position: sticky; top: 76px; }
.home-main { display: grid; gap: 18px; min-width: 0; }
.mini-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); transition: border-color .25s, box-shadow .25s, transform .25s; }
.mini-card:hover { border-color: rgba(232,121,30,.45); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mini-card > span:last-child { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.mini-card strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card small { font-size: 12px; }
.mini-card.emergency { margin-top: 16px; border-color: rgba(179,70,50,.3); background: var(--red-soft); }
.mini-card.emergency .el-icon { background: var(--red); color: #fff; }

/* Suche */
.result-card { display: flex; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); transition: border-color .25s, box-shadow .25s; }
.result-card:hover { border-color: rgba(232,121,30,.45); box-shadow: var(--shadow-md); }
.result-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-snippet { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.result-snippet mark { background: var(--orange-soft); color: var(--ink); border-radius: 3px; padding: 0 2px; }

.empty-state { text-align: center; padding: 36px 20px; border: 1px dashed var(--line); border-radius: var(--radius-xl); color: var(--ink-soft); background: var(--card); }
.empty-state.ok { color: var(--green); background: var(--green-soft); border-color: transparent; }
.rev-card summary { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; cursor: pointer; }
.rev-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.emergency-head { background: linear-gradient(135deg, #fff 0%, #fff 55%, var(--red-soft) 140%); border-color: rgba(179,70,50,.25); }
.emergency-head .eyebrow { color: var(--red); }
.emergency-section { margin-bottom: 26px; }

/* Responsive */
@media (max-width: 1100px) {
  .node-grid, .home-grid { grid-template-columns: minmax(0, 1fr); }
  .node-info, .home-side { position: static; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; width: 44px; height: 44px; }
  .sidebar { width: min(320px, 88vw); top: 0; bottom: 0; height: 100%; }
  .home-hero { grid-template-columns: 1fr; padding: 22px; }
}
@media (max-width: 600px) {
  .node-page, .home { padding: 14px 14px 48px; }
  .el-head { padding: 14px 14px 0; flex-direction: column; }
  .el-body { padding: 12px 14px 16px; }
  .ack-box { margin: 0 14px 14px; }
  .el-actions { opacity: 1; }
  .icon-btn.sm { width: 40px; height: 40px; }
  .file-btns { width: 100%; } .file-btns .btn { flex: 1; justify-content: center; min-height: 44px; }
  .folder-head { padding: 18px; }
  .hero-search { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Druck */
@media print {
  .sidebar, .topbar, .node-info, .el-actions, .breadcrumb, .new-menu, .flash-wrap, .ack-box form, .bpmn-tools { display: none !important; }
  .app-shell { display: block; height: auto; overflow: visible; }
  .content-scroll { overflow: visible; }
  .node-grid { display: block; }
  .el-card { box-shadow: none; border: 0; page-break-inside: avoid; }
  body.print-one .reading-flow > *:not(.print-target), body.print-one .folder-head, body.print-one .node-main > *:not(.reading-flow):not(.print-target) { display: none !important; }
}

/* Wiedervorlage & Kommentare */
.resub-box { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; padding: 14px 18px; margin-bottom: 16px; border-radius: var(--radius-xl); background: var(--orange-soft); border: 1px solid rgba(232,121,30,.4); }
.resub-box.is-overdue { background: var(--red-soft); border-color: rgba(179,70,50,.35); }
.resub-box p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.resub-form { display: flex; gap: 8px; flex-wrap: wrap; }
.resub-form .form-input { min-width: 200px; padding: 8px 12px; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; margin-top: 6px; }
.comments { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.comment header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.comment p { margin: 8px 0 0; font-size: 14px; line-height: 1.6; }
.comment.reply { margin: 10px 0 0 18px; background: var(--paper); }
.comment-del { margin-left: auto; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--ink-soft); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--red); }
.reply-form summary { cursor: pointer; font-size: 13px; color: var(--orange-deep); margin-top: 8px; padding: 4px 0; }
.reply-form form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: flex-start; }
.comment-new { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; }
.comment-new-row { display: flex; gap: 8px; margin-top: 8px; }
.comment-new-row .form-select { max-width: 260px; }
.comment-link { display: inline-block; margin: -6px 20px 14px; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.comment-link:hover { color: var(--orange-deep); text-decoration: underline; }
@media print { .comments, .comment-link, .resub-box { display: none !important; } }
.person-card.is-inactive { opacity: .55; }
.person-photo { transition: transform .3s; }
.person-card:hover .person-photo { transform: scale(1.06); }
