
  :root {
    --navy: #0b1f3a;
    --navy-2: #12294d;
    --accent: #1d4ed8;
    --border: #e3e6ea;
    --text: #1a1f29;
    --muted: #6b7280;
    --bg: #f7f8fa;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); overflow: hidden; }
  .app { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

  
  .sidebar { width: 88px; flex-shrink: 0; position: relative; z-index: 60; }
  .sidebar-inner {
    position: absolute; inset: 0; width: 88px; min-width: 88px;
    background: var(--navy); color: #cfd8e8; display: flex; flex-direction: column;
    overflow: hidden; white-space: nowrap;
    transition: width .16s ease, box-shadow .16s ease;
  }
  .sidebar:hover .sidebar-inner, .sidebar-inner.force-expand, .sidebar-inner.pinned {
    width: 250px; overflow: visible; box-shadow: 6px 0 28px rgba(0,0,0,0.35);
  }
  .sidebar-inner .lbl { opacity: 0; transition: opacity .1s ease; min-width: 0; }
  .sidebar:hover .sidebar-inner .lbl, .sidebar-inner.force-expand .lbl, .sidebar-inner.pinned .lbl { opacity: 1; transition: opacity .14s ease .06s; }
  .sidebar .icon { flex: 0 0 auto; width: 20px; text-align: center; font-size: 15px; line-height: 1; }

  .sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 16px 14px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 14px; }
  .sidebar .brand .icon { font-size: 18px; }
  .sidebar .brand small { display:block; font-weight:400; color:#8ea3c7; font-size:11px; margin-top:2px;}
  .sidebar .brand .brand-text { flex: 1; min-width: 0; }
  .sidebar-collapse-btn { flex: 0 0 auto; background: none; border: 1px solid rgba(255,255,255,0.18); color: #8ea3c7; cursor: pointer; font-size: 11px; padding: 4px 7px; border-radius: 6px; line-height: 1; }
  .sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
  .sidebar .section { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #7c8bab; }
  .sidebar .item { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: #cfd8e8; }
  .sidebar .item > .lbl { flex: 0 0 0; width: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .sidebar:hover .sidebar-inner .item > .lbl, .sidebar-inner.force-expand .item > .lbl, .sidebar-inner.pinned .item > .lbl { flex: 1 1 auto; width: auto; }
  .sidebar .item:hover { background: rgba(255,255,255,0.06); }
  .sidebar .item.active { background: rgba(255,255,255,0.1); color: #fff; }
  .sidebar .item.new-project { color: #7c8bab; margin-top: 2px; }
  .sidebar .item.new-project:hover { color: #cfd8e8; }
  .sidebar .item.new-chat { color: #cfd8e8; font-weight: 600; margin: 4px 8px 2px; border-radius: 8px; }
  .sidebar .item.new-chat:hover { background: rgba(255,255,255,0.08); }

  
  .sidebar .sidebar-inner .brand .icon,
  .sidebar .sidebar-inner .workspace-switcher,
  .sidebar .sidebar-inner .section,
  .sidebar .sidebar-inner .rail-hidden,
  .sidebar .sidebar-inner .note { display: none; }   
  .sidebar:hover .sidebar-inner .brand .icon,
  .sidebar-inner.force-expand .brand .icon,
  .sidebar-inner.pinned .brand .icon,
  .sidebar:hover .sidebar-inner .workspace-switcher,
  .sidebar-inner.force-expand .workspace-switcher,
  .sidebar-inner.pinned .workspace-switcher { display: block; }
  .sidebar:hover .sidebar-inner .section,
  .sidebar-inner.force-expand .section,
  .sidebar-inner.pinned .section,
  .sidebar:hover .sidebar-inner .rail-hidden,
  .sidebar-inner.force-expand .rail-hidden,
  .sidebar-inner.pinned .rail-hidden { display: flex; }
  .sidebar:hover .sidebar-inner .note,
  .sidebar-inner.force-expand .note,
  .sidebar-inner.pinned .note { display: flex; }

  
  .sidebar .ghp-list { flex-direction: column; padding: 0 0 4px; }
  .sidebar .ghp-item { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 32px; font-size: 12.5px; cursor: pointer; color: #a9b8d6; }
  .sidebar .ghp-item:hover { background: rgba(255,255,255,0.06); color: #cfd8e8; }
  .sidebar .ghp-item.active { color: #fff; }
  .sidebar .ghp-item .icon { font-size: 10px; flex: 0 0 auto; }
  .sidebar .ghp-item .ghp-item-lbl { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
  .sidebar .ghp-item .ghp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .ghp-item .ghp-sub { font-size: 10.5px; color: #7c8bab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar .ghp-empty { padding: 4px 14px 8px 32px; font-size: 11.5px; color: #5f739c; }
  
  .sidebar .settings-submenu { display: none; flex-direction: column; padding: 0 0 4px; }
  .sidebar:hover .sidebar-inner .settings-submenu.open,
  .sidebar-inner.force-expand .settings-submenu.open,
  .sidebar-inner.pinned .settings-submenu.open { display: flex; }
  .sidebar .settings-subitem { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 32px; font-size: 12.5px; cursor: pointer; color: #a9b8d6; }
  .sidebar .settings-subitem:hover { background: rgba(255,255,255,0.06); color: #cfd8e8; }
  .sidebar .item .chevron { flex: 0 0 auto; color: #7c8bab; font-size: 10px; transition: transform .12s ease; }
  .sidebar .item.settings-open .chevron { transform: rotate(90deg); }

  
  .ghp-modal-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
  .ghp-modal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
  .ghp-modal-item:hover { background: #f5f7fb; border-color: var(--border); }
  .ghp-modal-item .ghp-modal-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
  .ghp-modal-item .ghp-modal-project { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); background: #eef1f8; border-radius: 999px; padding: 2px 9px; }
  .ghp-modal-item .ghp-modal-time { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); min-width: 128px; text-align: right; }
  .ghp-modal-empty { padding: 10px 4px; font-size: 13px; color: var(--muted); }

  
  .project-chat-flyout { position: fixed; min-width: 220px; max-width: 280px; background: #12294d; color: #cfd8e8; border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.4); z-index: 80; padding: 6px 0; max-height: 60vh; overflow-y: auto; }
  .project-chat-flyout .pcf-header { padding: 6px 14px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #7c8bab; font-weight: 700; }
  .project-chat-flyout .pcf-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }
  .project-chat-flyout .pcf-item { display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
  .project-chat-flyout .pcf-item:hover { background: rgba(255,255,255,0.08); }
  .project-chat-flyout .pcf-item.pcf-new { color: #cfd8e8; font-weight: 600; }
  .project-chat-flyout .pcf-item.active { color: #fff; }
  .project-chat-flyout .pcf-item .chat-dot { font-size: 9px; color: #5f739c; flex: 0 0 auto; }
  .project-chat-flyout .pcf-item.active .chat-dot { color: var(--accent); }
  .project-chat-flyout .pcf-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .project-chat-flyout .pcf-empty { padding: 6px 14px 8px; font-size: 12px; color: #7c8bab; white-space: normal; }
  .project-chat-flyout .pcf-delete { flex: 0 0 auto; background: none; border: none; color: #7c8bab; cursor: pointer; font-size: 12px; padding: 3px 5px; border-radius: 5px; opacity: 0; line-height: 1; }
  .project-chat-flyout .pcf-chat:hover .pcf-delete { opacity: 1; }
  .project-chat-flyout .pcf-delete:hover { color: #f87171; background: rgba(248,113,113,0.14); }

  
  .chat-context-label { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
  .sidebar .item-avatar { flex: 1 1 auto; width: 100%; height: 24px; padding: 0 4px; border-radius: 6px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: -.1px; font-weight: 700; color: #cfd8e8; white-space: nowrap; transition: flex .12s ease, font-size .12s ease; }
  .sidebar .item.active .item-avatar { background: var(--accent); color: #fff; }
  .sidebar:hover .sidebar-inner .item-avatar, .sidebar-inner.force-expand .item-avatar, .sidebar-inner.pinned .item-avatar { flex: 0 0 auto; width: auto; min-width: 20px; height: 20px; font-size: 9px; letter-spacing: -.2px; border-radius: 5px; }

  
  .workspace-switcher { position: relative; padding: 10px 12px 12px; }
  .workspace-btn { width: 100%; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #fff; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
  .workspace-btn:hover { background: rgba(255,255,255,0.1); }
  .workspace-btn .lbl { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .workspace-btn .chevron { color: #8ea3c7; font-size: 11px; }
  
  .sidebar .workspace-rail { display: flex; align-items: center; justify-content: center;
                             padding: 10px 0 12px; cursor: pointer;
                             border-bottom: 1px solid rgba(255,255,255,0.08); }
  .sidebar:hover .sidebar-inner .workspace-rail,
  .sidebar-inner.force-expand .workspace-rail,
  .sidebar-inner.pinned .workspace-rail { display: none; }
  .sidebar .workspace-rail:hover { background: rgba(255,255,255,0.06); }
  
  .sidebar .workspace-rail-text { writing-mode: vertical-rl; transform: rotate(180deg);
                                  height: 96px; max-width: 66px; overflow: hidden;
                                  
                                  white-space: normal;
                                  font-size: 14px; font-weight: 600; line-height: 1.4;
                                  letter-spacing: .01em; color: #cfd8e8; text-align: center;
                                  overflow-wrap: anywhere; }
  .workspace-menu { position: absolute; left: 12px; right: 12px; top: 100%; margin-top: 4px; background: #12294d; border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.4); z-index: 40; overflow: visible; }
  .workspace-menu-list { border-radius: 8px; }
  .workspace-menu-row { position: relative; display: flex; align-items: center; }
  .workspace-menu-row:hover { background: rgba(255,255,255,0.08); }
  .workspace-menu-item { flex: 1; padding: 9px 4px 9px 12px; font-size: 13px; color: #cfd8e8; cursor: pointer; }
  .workspace-menu-item.active { color: #fff; font-weight: 600; }
  .workspace-menu-more { background: none; border: none; color: #7c8bab; cursor: pointer; padding: 6px 10px; font-size: 14px; line-height: 1; }
  .workspace-menu-more:hover { color: #fff; }
  .workspace-submenu { position: absolute; right: 6px; top: 100%; margin-top: 2px; background: #0b1f3a; border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.45); min-width: 150px; overflow: hidden; z-index: 50; }
  .workspace-submenu-item { padding: 8px 12px; font-size: 12.5px; color: #cfd8e8; cursor: pointer; white-space: nowrap; }
  .workspace-submenu-item:hover { background: rgba(255,255,255,0.08); }
  .workspace-submenu-item.danger { color: #f87171; }
  .workspace-submenu-item.danger:hover { background: rgba(248,113,113,0.12); }
  .workspace-menu-new { padding: 9px 12px; font-size: 13px; color: #7c8bab; cursor: pointer; border-top: 1px solid rgba(255,255,255,0.12); border-radius: 0 0 8px 8px; }
  .workspace-menu-new:hover { color: #cfd8e8; background: rgba(255,255,255,0.06); }
  
  .sidebar .sicherung { display: none; align-items: flex-start; gap: 10px; padding: 8px 14px;
                        font-size: 11px; color: #6b7fa3; border-top: 1px solid rgba(255,255,255,0.1); }
  .sidebar:hover .sidebar-inner .sicherung,
  .sidebar-inner.force-expand .sicherung,
  .sidebar-inner.pinned .sicherung { display: flex; }
  .sidebar .sicherung.warnung { color: #fca5a5; background: rgba(185,28,28,0.18); }
  .sidebar .sicherung .icon { margin-top: 1px; }
  .sidebar .sicherung-text { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.4; }
  
  .norm-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor;
               cursor: pointer; }
  .norm-link:hover { border-bottom-style: solid; }
  .sidebar .spacer { flex: 1; }
  .sidebar .note { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; font-size: 11px; color: #6b7fa3; border-top: 1px solid rgba(255,255,255,0.1); }
  .sidebar .note .icon { margin-top: 1px; }

  
  .resizer { width: 6px; flex-shrink: 0; cursor: col-resize; background: var(--border); position: relative; }
  .resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; }
  .resizer:hover, .resizer.dragging { background: var(--accent); }

  
  .pane-collapse-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 3px 7px; border-radius: 6px; line-height: 1; }
  .pane-collapse-btn:hover { background: #f0f4ff; color: var(--accent); }
  
  
  .live-head { font-weight: 600; }
  .live-step { margin: 3px 0 0 16px; font-size: 11.5px; opacity: .85; }
  
  .msg .thought.live { display: block; }
  .msg .thought.live .live-top { display: flex; align-items: center; gap: 6px; }
  
  .diff-weg { text-decoration: line-through; color: #b42318; text-decoration-thickness: 1.5px; }
  .diff-neu { text-decoration: underline; text-decoration-thickness: 1.5px; color: #0b6b3a; background: rgba(11,107,58,.07); }
  .answer-heading { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
  .answer-heading:first-child { margin-top: 2px; }
  .answer-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; line-height: 1.45; }
  .answer-table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); padding: 5px 10px 5px 0; vertical-align: bottom; }
  .answer-table td { border-bottom: 1px solid #eef0f4; padding: 6px 10px 6px 0; vertical-align: top; }
  .answer-table tr:last-child td { border-bottom: none; }
  .answer-table td:last-child, .answer-table th:last-child { padding-right: 0; }
  
  .deep-btn { margin: 6px 0 2px; padding: 4px 10px; font-size: 11.5px; font-family: inherit;
              color: var(--text); background: #fff; border: 1px solid var(--border);
              border-radius: 6px; cursor: pointer; }
  .deep-btn:hover { background: #f3f5f9; border-color: #c9cfdb; }
  .vergleich-table { table-layout: fixed; }
  .vergleich-table th, .vergleich-table td { padding-right: 12px; overflow-wrap: anywhere; hyphens: auto; }
  .vergleich-table th:nth-child(1), .vergleich-table td:nth-child(1) { width: 5%; }
  .vergleich-table th:nth-child(2), .vergleich-table td:nth-child(2) { width: 30%; }
  .vergleich-table th:nth-child(3), .vergleich-table td:nth-child(3) { width: 30%; }
  .vergleich-table th:nth-child(4), .vergleich-table td:nth-child(4) { width: 24%; }
  .vergleich-table th:nth-child(5), .vergleich-table td:nth-child(5) { width: 11%; }
  
  .vergleich-table.v4 th:nth-child(1), .vergleich-table.v4 td:nth-child(1) { width: 22%; }
  .vergleich-table.v4 th:nth-child(2), .vergleich-table.v4 td:nth-child(2) { width: 38%; }
  .vergleich-table.v4 th:nth-child(3), .vergleich-table.v4 td:nth-child(3) { width: 28%; }
  .vergleich-table.v4 th:nth-child(4), .vergleich-table.v4 td:nth-child(4) { width: 12%; }
  .header-actions { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px 12px; flex: 0 1 auto; max-width: 60%; }
  .header-actions .pane-collapse-btn { text-align: left; }
  
  .patent-bib { display: none; position: absolute; top: 100%; left: 0; z-index: 40; margin-top: 0; padding: 10px 14px;
                grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 11.5px; line-height: 1.5;
                min-width: 420px; max-width: 720px; background: #fff; border: 1px solid var(--border);
                border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.13); }
  #filesProjectLabel:hover ~ .patent-bib:not(.is-empty),
  .patent-bib:not(.is-empty):hover { display: grid; }
  .patent-bib dt { color: var(--muted); white-space: nowrap; }
  .patent-bib dd { margin: 0; color: var(--text); }
  .patent-bib .bib-title { font-weight: 600; }
  
  .files-header .sub.has-bib { cursor: help; text-decoration: underline dotted rgba(15,23,42,.35); text-underline-offset: 3px; }
  
  .pane-collapse-btn.icon-only { display: inline-flex; align-items: center; justify-content: center; padding: 5px; color: var(--muted); }
  .pane-collapse-btn.icon-only svg { display: block; }
  .expand-chat-btn { background: #fff; border: 1px solid var(--accent); color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
  .expand-chat-btn:hover { background: #f0f4ff; }
  .expand-tab { position: fixed; top: 50%; transform: translateY(-50%); z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 0 8px 8px 0; padding: 12px 5px; cursor: pointer; box-shadow: 2px 0 8px rgba(0,0,0,0.08); font-size: 13px; color: var(--muted); display: none; }
  .expand-tab:hover { color: var(--accent); border-color: var(--accent); }
  .expand-tab.at-filelist { position: absolute; left: 0; }

  
  .chat-pane { width: 46%; min-width: 380px; flex-shrink: 0; display: flex; flex-direction: column; background: #fff; }
  .chat-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
  .chat-log { flex: 1; overflow-y: auto; padding: 18px; }
  .msg { margin-bottom: 16px; max-width: 92%; }
  .msg.user { margin-left: auto; }
  .msg .bubble { padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
  .msg.user .bubble { background: #eef2f7; }
  .msg.assistant .bubble { background: transparent; padding-left: 0; }
  .msg .thought { color: var(--muted); font-size: 12px; margin: 4px 0; display:flex; align-items:center; gap:6px;}
  .msg .thought .dot { width:6px;height:6px;border-radius:50%;background:var(--accent); animation: pulse 1s infinite ease-in-out; }
  @keyframes pulse { 0%,100%{opacity:.25;} 50%{opacity:1;} }
  .msg table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
  .msg table th, .msg table td { border-bottom: 1px solid var(--border); text-align: left; padding: 6px 8px; }
  .msg table th { color: var(--muted); font-weight: 600; }
  .msg .progress-line { font-size: 12.5px; color: var(--muted); margin: 2px 0; }
  .cite-missing { display:inline-block; padding:0 4px; margin:0 1px; border-radius:5px; background:#fef2f2; color:#b91c1c; font-size:10.5px; font-weight:700; border:1px dashed #fca5a5; vertical-align:2px; line-height:16px; cursor:help; }
  .cite-badge { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; padding:0 4px; margin:0 1px; border-radius:5px; background:#eef2ff; color:#4338ca; font-size:10.5px; font-weight:700; cursor:pointer; border:1px solid #c7d2fe; vertical-align:2px; text-decoration:none; line-height:1; }
  .cite-badge:hover { background:#e0e7ff; }
  
  .ext-cite-badge { display:inline-flex; align-items:center; justify-content:center; gap:1px; min-width:16px; height:16px; padding:0 4px; margin:0 1px; border-radius:5px; background:#ecfdf5; color:#047857; font-size:10.5px; font-weight:700; cursor:pointer; border:1px solid #a7f3d0; vertical-align:2px; text-decoration:none; line-height:1; }
  .ext-cite-badge:hover { background:#d1fae5; }
  .ext-cite-badge .arrow { font-size:8.5px; }
  
  .cite-badge.cite-badge-green { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
  .cite-badge.cite-badge-green:hover { background:#d1fae5; }
  .cite-badge.cite-badge-red { background:#fef2f2; color:#b91c1c; border-color:#fca5a5; }
  .cite-badge.cite-badge-red:hover { background:#fee2e2; }
  
  .cite-badge.timeline-step-link { display:inline; min-width:0; height:auto; padding:0; margin:0;
    border:none; background:none; border-radius:0; font-size:inherit; font-weight:inherit;
    line-height:inherit; vertical-align:baseline; color:inherit; text-decoration:none; }
  .cite-badge.timeline-step-link:hover { background:none; text-decoration:underline;
    text-underline-offset:2px; text-decoration-color:rgba(0,0,0,.3); }
  .thought-box { margin: 4px 0 10px 0; font-size: 12.5px; }
  .thought-box summary { cursor: pointer; color: var(--muted); list-style: none; display:flex; align-items:center; gap:5px; }
  .thought-box summary::-webkit-details-marker { display:none; }
  .thought-box summary::before { content: "›"; display:inline-block; transition: transform .15s; font-weight:700; }
  .thought-box[open] summary::before { transform: rotate(90deg); }
  .thought-box .thought-body { margin: 6px 0 0 14px; color: var(--muted); }
  .thought-box .thought-body ul { margin: 4px 0; padding-left: 18px; }
  .thought-box .thought-body li { margin: 2px 0; }
  .citation-note { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
  .options { border: 1px solid var(--border); border-radius: 8px; margin-top: 10px; overflow: hidden; }
  .options .opt-head { padding: 8px 12px; font-size: 12px; font-weight:600; background:#f3f5f8; border-bottom:1px solid var(--border);}
  .options .opt { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer; }
  .options .opt:last-child { border-bottom: none; }
  .options .opt:hover { background: #f0f4ff; }
  .options .opt b { color: var(--accent); margin-right:6px; }


  .composer { padding: 12px 18px 18px; display: flex; gap: 8px; }
  
  .composer-field { flex: 1; position: relative; display: flex; }
  .composer-field input { flex: 1; padding: 10px 12px 10px 40px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; width: 100%; }
  
  .composer .composer-plus-btn { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #f4f6fb; color: #46516b; cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; font-family: inherit; }
  .composer .composer-plus-btn:hover { background: #e8ecf7; color: var(--navy); }
  .add-menu { position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 240px; z-index: 42; padding: 4px 0; }
  .add-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 13px; font-size: 13px; cursor: pointer; white-space: nowrap; }
  .add-menu-item:hover { background: #f0f4ff; }
  .add-menu-item .add-menu-icon { flex: 0 0 auto; width: 16px; text-align: center; }
  .add-menu-hint { padding: 4px 13px 7px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; white-space: normal; }
  
  .attached-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 8px; }
  .attached-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 340px; background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 11.5px; font-weight: 600; }
  .attached-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .attached-chip .chip-remove { flex: 0 0 auto; background: none; border: none; color: #4f46e5; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px; border-radius: 50%; font-family: inherit; }
  .attached-chip .chip-remove:hover { background: #c7d2fe; }
  
  .pasted-image-chip { display: flex; align-items: center; gap: 8px; margin: 0 18px 8px; background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; border-radius: 10px; padding: 6px 8px; font-size: 11.5px; font-weight: 600; max-width: 320px; }
  .pasted-image-chip .pasted-image-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd6fe; flex: 0 0 auto; }
  .pasted-image-chip .pasted-image-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .pasted-image-chip .pasted-image-remove { flex: 0 0 auto; background: none; border: none; color: #7c3aed; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px; border-radius: 50%; font-family: inherit; }
  .pasted-image-chip .pasted-image-remove:hover { background: #ddd6fe; }
  .user-msg-image { display: block; max-width: 260px; max-height: 220px; border-radius: 10px; margin-bottom: 6px; object-fit: contain; }
  
  .files-table tr.file .file-attach-btn { opacity: .45; background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 3px 5px; border-radius: 5px; flex: 0 0 auto; color: #46516b; }
  .files-table tr.file:hover .file-attach-btn { opacity: 1; }
  .files-table tr.file .file-attach-btn:hover { background: #e0e7ff; color: #3730a3; }
  .files-table tr.file .file-attach-btn.attached { opacity: 1; color: #3730a3; }
  
  .files-pane.attach-mode .files-table tr.file { cursor: copy; }
  .files-pane.attach-mode .files-table tr.file:hover td { background: #eef2ff; }
  .files-pane.attach-mode .files-table tr.file .file-attach-btn { opacity: 1; }
  .attach-mode-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 14px; font-size: 12px; color: #3730a3; background: #eef2ff; border-bottom: 1px solid #c7d2fe; }
  .attach-mode-done { flex: 0 0 auto; background: #fff; border: 1px solid #c7d2fe; color: #3730a3; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer; font-family: inherit; }
  .attach-mode-done:hover { background: #e0e7ff; }
  
  .attachment-note { margin: -2px 0 10px; font-size: 11.5px; color: #4338ca; text-align: right; }
  .attachment-note code { background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 4px; padding: 1px 5px; font-size: 11px; }
  .composer button { background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 0 16px; cursor: pointer; font-size: 13px; }
  .composer button:disabled { opacity: .4; cursor: default; }
  
  .composer button.stop-mode { background: #0f172a; width: 40px; padding: 0; display: flex; align-items: center; justify-content: center; }
  .composer button.stop-mode .stop-icon { width: 11px; height: 11px; background: #fff; border-radius: 2px; display: inline-block; }

  
  .files-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
  .files-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
  .files-header .title { font-weight: 600; font-size: 14px; }
  .files-header .sub { font-size: 12px; color: var(--muted); margin-top:2px; }
  .files-table { flex: 1; overflow-y: auto; }
  .files-table table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; }
  .files-table th { position: sticky; top:0; background:#fff; text-align: left; padding: 8px 20px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
  .files-table th:nth-child(2), .files-table th:nth-child(3) { width: 170px; }
  .files-table td { padding: 6px 20px; border-bottom: 1px solid #f0f1f3; white-space: nowrap; overflow:hidden; text-overflow:ellipsis; }
  
  .files-table td.name { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
  .files-table tr.folder td.name { font-weight: 600; cursor: pointer; }
  .files-table tr.folder td.name::before { content: "📁 "; }
  .files-table tr.folder td.name .folder-count { font-weight: 400; color: var(--muted); font-size: 12px; }
  .files-table tr.file td.name::before { content: "📄 "; color: var(--muted); }
  .files-table tr.file.indent td.name { padding-left: 40px; }
  .files-table tr:hover { background: #fafbfc; }
  .files-table tr.type-filter-row td { padding: 6px 20px 6px 40px; white-space: normal; background: #fafbfc; overflow: visible; }
  .files-table tr.folder.unsorted td.name::before { content: "📥 "; }
  .files-table tr.file { cursor: grab; }
  .files-table tr.file.dragging { opacity: 0.4; }
  .files-table tr.folder.drag-over td { background: #e0e9ff; outline: 2px dashed var(--accent); outline-offset: -2px; }
  .readability-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 20px; font-size: 12px; border-bottom: 1px solid var(--border); background: #f7f9fc; color: var(--muted); }
  .readability-bar.warn { background: #fff7ed; color: #9a3412; }
  .readability-bar.running { background: #eff6ff; color: #1e40af; }
  .readability-detail { font-size: 11px; opacity: .85; margin-top: 3px; }
  .readability-files { font-size: 11.5px; margin-top: 5px; display: flex; flex-direction: column; gap: 2px; }
  .readability-file-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(0,0,0,.28); cursor: pointer; }
  .readability-file-link:hover { text-decoration-color: currentColor; }
  .readability-file-note { opacity: .75; }
  .readability-btn { font-size: 11.5px; color: var(--accent); cursor: pointer; border: 1px solid var(--border); background: #fff; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
  .readability-btn:hover { background: #f0f4ff; }
  .ocr-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 700; letter-spacing: .3px; vertical-align: middle; border: none; font-family: inherit; }
  .ocr-badge.ok { background: #dcfce7; color: #166534; }
  .ocr-badge.done { background: #eef1f5; color: #64748b; }
  .ocr-badge.open { background: #fee2e2; color: #991b1b; cursor: pointer; }
  .ocr-badge.open:hover { background: #fecaca; }
  .files-table tr.file .file-delete-btn { opacity: 0; background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 5px; flex: 0 0 auto; }
  .files-table tr.file:hover .file-delete-btn { opacity: 1; }
  .files-table tr.file .file-delete-btn:hover { background: #fde8e8; }
  .files-table tr.file.selected td { background: #dbe6ff; }
  .files-table tr.file.selected.active-pdf td { background: #c7d7ff; }
  
  .files-table td.folder-actions { text-align: right; white-space: nowrap; overflow: visible; text-overflow: clip; }
  .files-table tr.folder .folder-action-btn { opacity: 0; background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 5px; }
  .files-table tr.folder:hover .folder-action-btn { opacity: 1; }
  .files-table tr.folder .folder-action-btn:hover { background: #eef1f6; }
  
  .files-table td.file-actions { overflow: visible; text-overflow: clip; white-space: nowrap; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
  .doc-tag-select { font-size: 11.5px; padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border); background: #fff; color: var(--muted); max-width: 118px; }
  .doc-tag-select.tag-streitpatent { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 600; }
  .doc-tag-select.tag-anmeldeunterlage { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }
  .doc-tag-select.tag-stammanmeldung { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; font-weight: 600; }
  .doc-tag-select.tag-prioritaetsdokument { background: #fef3c7; border-color: #fcd34d; color: #92400e; font-weight: 600; }

  
  .origin-filter { position: relative; display: inline-block; }
  .origin-filter-btn { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
  .origin-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
  .origin-filter-btn .caret { color: var(--muted); margin-left: 2px; }
  
  .origin-menu { display: none; position: fixed; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.1); min-width: 230px; padding: 4px 0; z-index: 30; }
  .origin-filter.open .origin-menu { display: block; }
  .origin-menu-item { position: relative; padding: 7px 14px; font-size: 12.5px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .origin-menu-item:hover { background: #f0f4ff; }
  .origin-menu-item .sub-caret { color: var(--muted); font-size: 10px; }
  .origin-submenu { display: none; position: absolute; left: 100%; top: -5px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.1); min-width: 280px; max-height: 340px; overflow-y: auto; padding: 4px 0; z-index: 31; }
  .origin-submenu.flip-left { left: auto; right: 100%; }
  .origin-menu-item.has-sub:hover .origin-submenu { display: block; }
  .origin-submenu-item { padding: 6px 14px; font-size: 12px; cursor: pointer; white-space: normal; line-height: 1.35; }
  .origin-submenu-item:hover { background: #f0f4ff; }
  .empty-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); font-size: 13px; }
  .empty-state .big { font-size: 32px; margin-bottom: 8px; }
  .badge { display:inline-block; font-size:11px; padding:2px 7px; border-radius:999px; background:#eef2f7; color:var(--muted); margin-left:8px; }

  
  .files-body { display: flex; flex: 1; min-height: 0; position: relative; }
  .files-body .files-table { flex: 1; min-width: 0; }
  .pdf-viewer-panel { width: 48%; min-width: 280px; display: flex; flex-direction: column; background: #f7f8fa; flex-shrink: 0; }
  .pdf-viewer-header { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; }
  .pdf-viewer-header .fname { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pdf-viewer-header .actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
  .pdf-viewer-header a, .pdf-viewer-header .close-btn { font-size: 12px; color: var(--accent); text-decoration: none; cursor: pointer; background: none; border: none; padding: 0; }
  .pdf-viewer-header .close-btn { color: var(--muted); font-size: 15px; }
  .pdf-viewer-panel iframe { flex: 1; border: none; width: 100%; }
  #pdfCanvasWrap { flex: 1; overflow: auto; position: relative; background: #6b7280; padding: 16px 12px 52px; text-align: center; }
  #pdfCanvasInner { position: relative; display: inline-block; }
  #pdfCanvas { display: block; box-shadow: 0 1px 4px rgba(0,0,0,.35); background: #fff; }
  .pdf-text-layer { position: absolute; top: 0; left: 0; overflow: hidden; opacity: 0; line-height: 1; pointer-events: none; }
  .pdf-text-layer > span { position: absolute; white-space: pre; transform-origin: 0% 0%; }
  #pdfHighlightLayer { position: absolute; top: 0; left: 0; pointer-events: none; }
  .pdf-highlight-rect { position: absolute; background: rgba(255, 208, 0, .38); mix-blend-mode: multiply; border: 1px solid rgba(217, 160, 0, .55); border-radius: 2px; }
  
  .pdf-highlight-rect.kat-orange { background: rgba(255, 140, 0, .38); border-color: rgba(204, 102, 0, .6); }
  .pdf-highlight-rect.kat-cyan   { background: rgba(0, 188, 212, .34); border-color: rgba(0, 131, 143, .6); }
  .pdf-highlight-rect.kat-gelb   { background: rgba(255, 208, 0, .38); border-color: rgba(217, 160, 0, .55); }
  .pdf-highlight-rect.kat-gruen  { background: rgba(76, 175, 80, .34); border-color: rgba(46, 125, 50, .6); }
  .pdf-highlight-rect.kat-pink   { background: rgba(233, 30, 99, .3); border-color: rgba(173, 20, 74, .6); }
  .pdf-farbschema-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); background: #fafafa; font-size: 12px; }
  .pdf-farbschema-legend label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
  .pdf-farbschema-legend .swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,.25); }
  .pdf-farbschema-legend label.kat-orange .swatch { background: rgba(255, 140, 0, .8); }
  .pdf-farbschema-legend label.kat-cyan .swatch   { background: rgba(0, 188, 212, .8); }
  .pdf-farbschema-legend label.kat-gelb .swatch   { background: rgba(255, 208, 0, .8); }
  .pdf-farbschema-legend label.kat-gruen .swatch  { background: rgba(76, 175, 80, .8); }
  .pdf-farbschema-legend label.kat-pink .swatch   { background: rgba(233, 30, 99, .7); }
  .farbschema-btn { border: 1px solid var(--border); background: #f4f6fb; color: #46516b; cursor: pointer;
    font-size: 10.5px; font-weight: 700; letter-spacing: .2px; padding: 1px 8px; border-radius: 999px;
    font-family: inherit; opacity: .9; }
  .farbschema-btn:hover { opacity: 1; background: #e8ecf7; }
  .farbschema-btn:disabled { cursor: wait; opacity: .8; }
  .farbschema-wrap { display: inline-flex; align-items: center; gap: 1px; }
  .farbschema-caret-btn { border: none; background: transparent; cursor: pointer; font-size: 10px; padding: 0 1px; opacity: .4; line-height: 1; }
  .farbschema-caret-btn:hover { opacity: .9; }
  .farbschema-picker { position: fixed; z-index: 500; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 8px 10px; font-size: 12px; min-width: 190px; }
  .farbschema-picker label { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; white-space: nowrap; }
  .farbschema-picker .swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,.25); flex: 0 0 auto; }
  .farbschema-picker label.kat-orange .swatch { background: rgba(255, 140, 0, .8); }
  .farbschema-picker label.kat-cyan .swatch   { background: rgba(0, 188, 212, .8); }
  .farbschema-picker label.kat-gelb .swatch   { background: rgba(255, 208, 0, .8); }
  .farbschema-picker label.kat-gruen .swatch  { background: rgba(76, 175, 80, .8); }
  .farbschema-picker label.kat-pink .swatch   { background: rgba(233, 30, 99, .7); }
  .farbschema-picker-actions { display: flex; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
  .farbschema-picker-actions button { flex: 1 1 auto; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; cursor: pointer; background: #fff; }
  .farbschema-picker-los { background: var(--accent, #2563eb) !important; color: #fff; border-color: transparent !important; }
  .pdf-render-note { color: #fff; background: rgba(0,0,0,.55); font-size: 12px; padding: 6px 10px; border-radius: 6px; margin: 0 auto 10px; max-width: 90%; }
  .pdf-canvas-nav { position: sticky; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.95); border-top: 1px solid var(--border); padding: 6px 10px; margin: 12px -12px -52px; }
  .pdf-canvas-nav button { font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
  .pdf-canvas-nav button:hover { background: #f4f5f7; }
  .pdf-canvas-nav button:disabled { opacity: .4; cursor: default; }
  .pdf-canvas-nav .page-indicator { font-size: 12px; color: var(--muted); min-width: 90px; text-align: center; }
  .files-table tr.file.active-pdf td { background: #eef2ff; }
  
  .files-table .file-name-link { color: var(--text); text-decoration: none; cursor: pointer; }
  .files-table .file-name-link:visited { color: var(--text); }
  .files-table .file-name-link:hover { color: var(--text); text-decoration: underline; text-decoration-color: rgba(15,23,42,.45); text-underline-offset: 2px; }

  
  .modal-overlay { position: fixed; inset: 0; background: rgba(11,31,58,0.45); display: none; align-items: center; justify-content: center; z-index: 50; }
  .modal-overlay.open { display: flex; }
  .modal-box { background: #fff; width: 560px; max-width: 92vw; max-height: 86vh; overflow-y: auto; border-radius: 10px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
  .modal-box.modal-box-wide { width: 720px; }
  
  .modal-box.modal-box-skills-list { width: 1160px; max-width: 95vw; }
  .modal-box.modal-box-xwide { width: 980px; max-width: 95vw; }
  
  .modal-box.modal-box-editor { width: 900px; max-width: 90vw; height: 78vh; max-height: 78vh; display: flex; flex-direction: column; overflow: hidden; }
  .modal-box.modal-box-editor.has-auslegung { width: 1140px; height: 86vh; max-height: 86vh; }
  
  .text-editor-canvas { flex: 1; min-height: 0; overflow-y: auto; background: #e8eaed; border-radius: 8px; padding: 28px 20px; margin-top: 6px; }
  .text-editor-page { background: #fff; max-width: 760px; margin: 0 auto; padding: 40px 44px 52px; box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 4px 14px rgba(0,0,0,0.1); border-radius: 2px; min-height: 100%; }
  .modal-box-editor.has-auslegung .text-editor-page { max-width: 1060px; }
  .text-editor-doc-title { font-family: Georgia, 'Times New Roman', Times, serif; font-size: 21px; font-weight: 700; line-height: 1.3; text-align: center; margin-bottom: 32px; color: var(--text); }
  .text-editor-preview { font-family: Georgia, 'Times New Roman', Times, serif; }
  .text-editor-preview h4 { font-size: 16px; margin: 26px 0 10px; color: var(--text); font-weight: 700; }
  .text-editor-preview h4:first-child { margin-top: 0; }
  .text-editor-preview p { font-size: 14px; margin: 8px 0; }
  
  .text-editor-preview table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 8px; font-size: 12.5px; line-height: 1.45; border: 1px solid #999; }
  .text-editor-preview th, .text-editor-preview td { text-align: left; padding: 6px 10px; border: 1px solid #999; vertical-align: top; overflow-wrap: break-word; }
  .text-editor-preview th { font-weight: 700; color: var(--text); font-size: 12px; background: #f4f5f6; }
  
  .text-editor-preview th:first-child, .text-editor-preview td:first-child { white-space: nowrap; width: 68px; }
  
  .text-editor-preview th:nth-child(2), .text-editor-preview td:nth-child(2) { width: 34%; }
  .text-editor-preview td.auslegung-cell { color: #333; }
  .text-editor-preview td.auslegung-cell:empty::before { content: '—'; color: var(--muted); }
  .text-editor-preview-empty { color: var(--muted); font-size: 13px; font-family: inherit; }
  
  
  .skills-group-list { columns: 240px 4; column-gap: 26px; margin-top: 10px; }
  .skill-group { break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
                 display: inline-block; width: 100%; margin: 0 0 16px; border-radius: 8px;
                 border: 1px dashed transparent; }
  
  .skill-group.drop-target { border-color: var(--accent); background: #f5f8ff; }
  .skill-group-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px;
                       color: var(--text); padding-bottom: 5px; margin-bottom: 5px;
                       border-bottom: 1px solid var(--border); }
  .skill-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  
  .skill-group-actions { flex: 0 0 auto; display: flex; gap: 1px; opacity: 0; transition: opacity .1s; }
  .skill-group:hover .skill-group-actions { opacity: 1; }
  .skill-group-btn { background: none; border: none; cursor: pointer; font-size: 11px; line-height: 1;
                     padding: 3px 4px; border-radius: 4px; color: var(--muted); font-family: inherit; }
  .skill-group-btn:hover { background: #e8edf7; }
  .skill-group-empty { font-size: 12px; color: var(--muted); font-style: italic; padding: 5px 7px; }
  .skill-group-add { display: inline-block; width: 100%; break-inside: avoid; font-size: 12.5px;
                     color: var(--accent); cursor: pointer; padding: 5px 7px; border-radius: 6px;
                     border: 1px dashed var(--border); text-align: center; }
  .skill-group-add:hover { background: #f5f8ff; border-color: var(--accent); }
  .skill-row { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 6px;
               font-size: 13px; cursor: pointer; }
  .skill-row:hover { background: #eef3ff; }
  .skill-row.is-dragging { opacity: .45; }
  .skill-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .skill-row.has-error .skill-row-name { color: #b91c1c; }
  .skill-row-warn { flex: 0 0 auto; font-size: 11px; }

  
  .modal-box.modal-box-skills-list { resize: horizontal; min-width: 520px; max-width: 98vw; }
  .skill-group-dropdown { font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--border);
                          border-radius: 6px; font-family: inherit; background: #fff; }

  
  .skills-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 56vh; overflow-y: auto; margin-top: 4px; align-content: start; }
  .skill-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; min-width: 0; }
  .skill-card:hover { background: #f7f8fa; border-color: var(--accent); }
  .skill-card-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .skill-card-trigger { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .skill-card-cats { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
  
  .skill-cat-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 700; line-height: 1.7; white-space: nowrap; }
  .skill-cat-badge.cat-epo { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
  .skill-cat-badge.cat-fcj { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
  .skill-cat-badge.cat-upc { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
  .skills-toolbar { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
  .skills-search-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
  
  
  .skill-trefferlage { position: absolute; overflow: hidden; pointer-events: none;
    white-space: pre-wrap; overflow-wrap: break-word; color: transparent;
    background: #fff; border-radius: 8px; z-index: 0; }
  .skill-trefferlage mark { color: transparent; background: #ffe9a3; border-radius: 2px; }
  .skill-trefferlage mark.aktiv { background: #ffb020; }
  
  .skill-lang-col textarea.hat-trefferlage,
  .skill-lang-col input[type="text"].hat-trefferlage { background: transparent; position: relative; z-index: 1; }
  
  .skill-lang-col input[type="text"].treffer-feld { box-shadow: 0 0 0 2px #ffb020 inset; }
  .skill-suche { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
  .skill-suche input { flex: 1; padding: 6px 9px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
  .skill-suche .zaehler { font-size: 12.5px; color: var(--muted); min-width: 92px;
    text-align: right; font-variant-numeric: tabular-nums; }
  .skill-suche button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; font-size: 13px; cursor: pointer; color: var(--fg); }
  .skill-suche button:hover:not(:disabled) { background: #f0f1f4; }
  .skill-suche button:disabled { opacity: .4; cursor: default; }
  .skill-suche .ohne-treffer { color: #b3261e; font-weight: 600; }
  
  .skill-suche input.ohne-treffer { color: inherit; font-weight: normal;
    border-color: #b3261e; background: #fdf3f2; }
  .skill-filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .skill-filter-tab { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12px; color: var(--muted); cursor: pointer; }
  .skill-filter-tab:hover { background: #f7f8fa; }
  .skill-filter-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
  .skill-cat-select { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
  .skill-cat-select-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 2px; }
  .skill-cat-checkbox { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
  .skill-lang-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-top: 6px; }
  .skill-lang-col { display: flex; flex-direction: column; min-width: 0; }
  .skill-lang-col-header { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; margin: 10px 0 6px; padding-top: 10px; border-top: 1px solid var(--border); }
  .skill-lang-col:first-child .skill-lang-col-header { border-top: none; padding-top: 0; margin-top: 0; }
  .skill-lang-col-header .translating-spinner { display: none; font-size: 11px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: normal; }
  .skill-lang-col-header.is-translating .translating-spinner { display: inline; }
  .skill-lang-col input[type="text"], .skill-lang-col textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }
  .skill-lang-col label { font-size: 12px; color: var(--muted); margin: 8px 0 3px; display: block; }
  .skill-lang-col label:first-of-type { margin-top: 0; }
  .skill-en-readonly-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
  .skill-used-badge { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }
  
  .norm-nav { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 2px; }
  .norm-btn { font-size:11.5px; padding:3px 10px; border-radius:999px; border:1px solid #d8dce6; background:#f6f7fb; color:#3b4252; cursor:pointer; font-family:inherit; }
  .norm-btn:hover:not(:disabled) { background:#eef2ff; border-color:#c7d2fe; color:#4338ca; }
  .norm-btn:disabled { opacity:.4; cursor:default; }
  
  .upc-btn { font-size:11.5px; font-weight:500; padding:3px 10px; border-radius:999px; border:1px solid #d8dce6; background:#f6f7fb; color:#3b4252; cursor:pointer; font-family:inherit; }
  .upc-btn:hover:not(:disabled) { background:#ecfdf5; border-color:#a7f3d0; color:#047857; }
  
  .quell-link { color:inherit; text-decoration:underline; text-underline-offset:2px; text-decoration-color:#a7f3d0; text-decoration-thickness:2px; }
  .quell-link:hover { text-decoration-color:#047857; }
  
  .rk-anker { background: #eef3fd; border-bottom: 2px solid #3b6fd8; border-radius: 2px; cursor: pointer; }
  .rk-anker:hover { background: #dbe5fb; }
  .rk-ziel-aktiv { background: #fff1a8; transition: background 1.5s; }
  
  .stream-preview { white-space:pre-wrap; margin:6px 0 2px; color:var(--muted); font-size:13.5px; line-height:1.55; border-left:2px solid #e5e7eb; padding-left:10px; }
  .upc-aktion { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 2px; }
  
  .folge-leiste { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 2px; padding-top:10px; border-top:1px solid #eceef3; }
  .folge-titel { width:100%; font-size:11.5px; color:#6b7280; margin-bottom:2px; }
  .folge-btn { font-size:11.5px; font-weight:500; padding:4px 11px; border-radius:999px; border:1px solid #d8dce6; background:#fff; color:#3b4252; cursor:pointer; font-family:inherit; text-align:left; }
  .folge-btn:hover:not(:disabled) { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
  .folge-btn:disabled { opacity:.5; cursor:default; }
  .upc-btn:disabled { opacity:.5; cursor:default; }
  
  .zm-leiste { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:12px 0 2px; padding-top:9px; border-top:1px solid #eceef3; }
  .zm-btn { font-size:11.5px; font-weight:500; padding:4px 11px; border-radius:999px; border:1px solid #d8dce6; background:#fff; color:#3b4252; cursor:pointer; font-family:inherit; }
  .zm-btn:hover:not(:disabled) { background:#f5f3ff; border-color:#ddd6fe; color:#6d28d9; }
  .zm-btn:disabled { opacity:.5; cursor:default; }
  .zm-select { font-size:11.5px; padding:3px 6px; border-radius:7px; border:1px solid #d8dce6; background:#fff; color:#3b4252; font-family:inherit; }
  .zm-hinweis { font-size:11px; color:#9aa1ad; }
  .zm-box { margin:10px 0 2px; border:1px solid #e3e6ee; border-left:3px solid #a78bfa; border-radius:8px; background:#fcfbff; padding:9px 12px; font-size:12.5px; }
  .zm-kopf { font-size:11px; color:#6b7280; margin-bottom:6px; }
  
  .zm-protokoll { font-size:11.5px; color:#4b5563; background:#f5f3ff; border-radius:6px;
                  padding:6px 9px; margin-bottom:9px; line-height:1.5; }
  
  .upc-btn-still { background:#f6f7fb; border-color:#d8dce6; color:#6b7280; font-weight:500; }
  .norm-btn.aktiv { background:#eef2ff; border-color:#c7d2fe; color:#4338ca; font-weight:600; }
  .norm-toc { margin:6px 0 2px; border:1px solid #e3e6ee; border-radius:8px; max-height:320px; overflow:auto; font-size:12px; background:#fcfcfe; }
  .norm-toc-kopf { position:sticky; top:0; background:#f2f4fa; padding:5px 9px; font-weight:600; font-size:11.5px; color:var(--muted); border-bottom:1px solid #e3e6ee; }
  
  .norm-toc-zeile { display:block; padding:3px 9px; color:#3b4252; text-decoration:none; cursor:pointer; }
  
  .norm-toc-pfeil { display:inline-block; width:13px; font-size:9px; color:#9aa3b5; }
  .norm-toc-zeile:hover { background:#eef0f5; }
  .norm-toc-zeile.abschnittskopf { font-weight:600; color:var(--muted); background:#f7f8fc; }
  .norm-toc-zeile.abschnittskopf:hover { background:#eef0f5; }
  .norm-toc-zeile.aktuell { background:#eef2ff; color:#4338ca; font-weight:600; }
  .skill-selector { position: relative; padding: 0 18px; margin-top: 4px; }
  .skill-selector-btn { background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
  .skill-selector-btn:hover { border-color: var(--accent); color: var(--accent); }
  .skill-selector-menu { position: absolute; left: 18px; bottom: 100%; margin-bottom: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 220px; max-width: 320px; max-height: 260px; overflow-y: auto; z-index: 40; padding: 4px 0; }
  .skill-selector-item { padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .skill-selector-item:hover { background: #f0f4ff; }
  .skill-selector-item.active { color: var(--accent); font-weight: 600; }
  .skill-selector-divider { height: 1px; background: var(--border); margin: 4px 0; }
  
  .skill-selector { display: flex; align-items: center; gap: 8px; }
  .perspektive-wrap { position: relative; }
  .perspektive-btn.partei { border-color: #b45309; color: #b45309; font-weight: 600; }
  .perspektive-menu { position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 260px; z-index: 41; padding: 4px 0; }
  .perspektive-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
  .perspektive-item:hover { background: #f0f4ff; }
  .perspektive-item.active { color: var(--accent); font-weight: 600; }
  .perspektive-item small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
  
  .assign-project-wrap { position: relative; }
  .assign-project-btn { background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
  .assign-project-btn:hover { background: #ffedd5; }
  .assign-project-menu { position: absolute; left: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 220px; max-width: 320px; max-height: 260px; overflow-y: auto; z-index: 40; padding: 4px 0; }
  .assign-project-item { padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .assign-project-item:hover { background: #f0f4ff; }
  .assign-project-empty { padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
  
  .source-filter-bar { display: inline-flex; align-items: center; gap: 8px; }
  .legal-sources-wrap { position: relative; }
  .legal-sources-btn { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
  .legal-sources-btn:hover { background: #dbeafe; }
  .legal-sources-btn.restricted { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
  .legal-sources-menu { position: absolute; left: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 250px; z-index: 41; padding: 6px 0; }
  .legal-source-item { display: block; padding: 6px 14px; font-size: 13px; font-weight: 600; color: #1d4ed8; cursor: pointer; user-select: none; }
  .legal-source-item:hover { background: #f1f5ff; }
  .legal-source-item.aus { color: #98a2b3; font-weight: 500; }
  .legal-sources-empty { padding: 8px 14px; font-size: 12.5px; color: var(--muted); }
  
  .legal-sources-alle { margin: 5px 8px 2px; padding-top: 6px; border-top: 1px solid var(--border); }
  .legal-sources-alle button { width: 100%; font-family: inherit; font-size: 12px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: #f8fafc; color: #3b4252; cursor: pointer; }
  .legal-sources-alle button:hover { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
  
  
  .pane-tab { cursor: pointer; user-select: none; color: var(--muted); font-weight: 600; }
  .pane-tab + .pane-tab { margin-left: 12px; }
  .pane-tab.is-active { color: var(--text, #1f2430); text-decoration: underline; text-underline-offset: 4px; }
  
  .pane-split-btn { font-size: 12px; font-weight: 600; }
  .pane-split-btn.is-active { text-decoration: none; background: #eef2ff; color: #4338ca;
    border-radius: 6px; padding: 1px 6px; }
  
  .akte-split { flex: 1 1 auto; display: flex; flex-direction: row; min-width: 0; min-height: 0; }
  .akte-split.senkrecht { flex-direction: column; }
  .akte-split > .files-table { flex: 1 1 auto; min-width: 0; min-height: 0; }
  .split-resizer { flex: 0 0 6px; background: var(--border); cursor: col-resize; position: relative; }
  .split-resizer::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: -3px; right: -3px; }
  .split-resizer:hover, .split-resizer.dragging { background: var(--accent); }
  .akte-split.senkrecht > .split-resizer { cursor: row-resize; }
  .tabellen-bereich { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
  .tabellen-leiste { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
  .tabellen-leiste select { font-family: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; max-width: 260px; }
  .tabelle-fuellen-btn { background: #111827; color: #fff; border-color: #111827; font-weight: 600; }
  .tabelle-fuellen-btn:hover { background: #1f2937; color: #fff; }
  .tabelle-fuellen-btn:disabled { opacity: .45; cursor: default; }
  .tabellen-menue-wrap { position: relative; display: inline-block; }
  .tabellen-menue { position: absolute; left: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 200px; z-index: 40; padding: 4px 0; font-size: 12.5px; }
  .tabellen-menue-item { padding: 6px 12px; cursor: pointer; white-space: nowrap; }
  .tabellen-menue-item:hover { background: #eef3ff; }
  .tabellen-menue-item.gefahr { color: #b91c1c; }
  .tabellen-menue-kopf { padding: 5px 12px 3px; font-size: 11.5px; color: var(--muted); }
  .tabellen-menue-trenner { height: 1px; background: var(--border); margin: 4px 0; }
  .tabellen-status { font-size: 12px; color: var(--muted); margin-left: auto; }
  .tabellen-raster { flex: 1 1 auto; overflow: auto; padding: 0 0 40px; }
  .tabellen-raster table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
  
  .tabellen-raster th { position: sticky; top: 0; z-index: 2; background: #f8fafc; border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border); text-align: left; padding: 7px 9px; font-weight: 700; vertical-align: top; }
  .tabellen-raster th .kopf-zeile { display: flex; align-items: center; gap: 6px; }
  .tabellen-raster th .spalten-auftrag { display: block; font-weight: 400; color: var(--muted); font-size: 11px;
    margin-top: 3px; max-width: 320px; white-space: normal; }
  .tabellen-raster td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
    padding: 6px 9px; vertical-align: top; min-width: 90px; max-width: 420px; white-space: pre-wrap; }
  .tabellen-raster td:focus { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; background: #fff; }
  .tabellen-raster td.zelle-nr { min-width: 54px; max-width: 70px; font-weight: 600; color: var(--muted); }
  .tabellen-raster tr:hover td { background: #fcfcfd; }
  
  .tabellen-raster td.frisch { animation: zelleFrisch 2.4s ease-out 1; }
  @keyframes zelleFrisch { 0% { background: #fff3c4; } 100% { background: transparent; } }
  .spalten-btn { border: none; background: none; cursor: pointer; font-size: 11px; opacity: .45; padding: 0 2px; }
  .spalten-btn:hover { opacity: 1; }
  
  .tabellen-raster th.gruppen-kopf { background: #eef2f7; font-size: 11.5px; letter-spacing: .2px; color: #334155;
    text-align: center; border-bottom: 1px solid var(--border); padding: 4px 9px; }
  .tabellen-raster th.gruppen-kopf.leer { background: #f8fafc; }
  .tabellen-raster th .spalten-format { display: inline-block; font-weight: 400; color: var(--muted); font-size: 10.5px;
    border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
  
  .tabellen-raster td { padding: 0; }
  .tabellen-raster td .zelle-text { padding: 6px 9px; min-height: 18px; white-space: pre-wrap; outline: none; }
  .tabellen-raster td .zelle-text:focus { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; background: #fff; }
  .tabellen-raster td.zelle-nr .zelle-text { font-weight: 600; color: var(--muted); }
  .tabellen-raster td .zelle-belege { padding: 0 9px 6px; display: flex; flex-wrap: wrap; gap: 3px; }
  .tabellen-raster td .zelle-belege .cite-badge { font-size: 10px; height: 15px; }

  
  .bibliothek-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .bibliothek-tabs { display: flex; gap: 4px; }
  .bibliothek-tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 12px;
    font-size: 12.5px; cursor: pointer; color: var(--muted); }
  .bibliothek-tab.active { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: #fff; }
  .chart-editor-kopf { display: grid; grid-template-columns: 1fr 1.6fr; gap: 0 16px; margin-top: 6px; }
  .chart-editor-kopf label, .chart-editor-block label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 3px; }
  .chart-editor-kopf input, .chart-editor-kopf textarea, .chart-zeilen-auftrag textarea,
  .chart-zeile input[type="text"], .chart-zeile textarea, .chart-zeile select, .chart-zeilen-auftrag select {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; }
  .chart-editor-block { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
  .chart-editor-block-titel { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
  .chart-hint { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
  .chart-zeilen-auftrag { display: grid; grid-template-columns: 1fr 260px; gap: 8px; align-items: start; }
  .chart-zeile { display: grid; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border); }
  .chart-zeile.gruppe { grid-template-columns: 1fr 240px auto auto; }
  .chart-zeile.spalte { grid-template-columns: 1fr 170px 160px 200px auto; }
  .chart-zeile .chart-zeile-auftrag { grid-column: 1 / -1; }
  .chart-zeile .chart-zeile-auftrag textarea { min-height: 34px; }
  .chart-zeile-werkzeuge { display: flex; gap: 2px; white-space: nowrap; }
  .chart-zeile-werkzeuge button { border: none; background: none; cursor: pointer; font-size: 12px; opacity: .55; padding: 0 3px; }
  .chart-zeile-werkzeuge button:hover { opacity: 1; }
  .chart-je-dok { font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
  
  .chart-vorschau { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 0; }
  .chart-vorschau table { font-size: 12px; }
  .chart-vorschau th { cursor: pointer; user-select: none; }
  .chart-vorschau th.spalten-kopf:hover, .chart-vorschau th.gruppen-kopf:hover { background: #eef3ff; }
  .chart-vorschau th.ausgewaehlt { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; background: #e8efff; }
  .chart-vorschau th.spalten-kopf.is-dragging { opacity: .45; }
  .chart-vorschau th.spalten-kopf.drop-links { box-shadow: inset 3px 0 0 var(--accent, #2563eb); }
  .chart-vorschau th.spalten-kopf.drop-rechts { box-shadow: inset -3px 0 0 var(--accent, #2563eb); }
  .chart-vorschau th.neu-kopf { cursor: pointer; color: var(--accent, #2563eb); font-weight: 600; white-space: nowrap; background: #fff; border-right: none; }
  .chart-vorschau th.neu-kopf:hover { text-decoration: underline; }
  .chart-vorschau th .dok-marke { font-weight: 400; color: var(--muted); }
  .chart-vorschau td { padding: 6px 9px; color: var(--muted); font-style: italic; white-space: pre-wrap; max-width: 260px; }
  .chart-vorschau td.zelle-nr { font-style: normal; }
  .chart-vorschau td .beispiel-kurz { font-style: normal; font-weight: 700; color: #334155; }
  .chart-vorschau .chart-vorschau-leer { padding: 16px; color: var(--muted); font-size: 12.5px; }
  .chart-gruppen-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; font-size: 12px; }
  .chart-gruppen-chips .chip-label { color: var(--muted); }
  .chart-chip { border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; cursor: pointer; background: #fff; }
  .chart-chip:hover { border-color: var(--accent, #2563eb); }
  .chart-chip.ausgewaehlt { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); }
  .chart-chip.leer { border-style: dashed; }
  .chart-chip.neu { color: var(--accent, #2563eb); border-style: dashed; }
  .chart-warnungen { margin-top: 6px; font-size: 12px; color: #92400e; display: flex; flex-direction: column; gap: 2px; }
  .chart-warnungen:empty { display: none; }
  
  .chart-kopfzeile { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 8px; }
  .chart-name-input { flex: 1; border: none; border-bottom: 1px solid transparent; font: inherit; font-size: 17px; font-weight: 700; padding: 4px 2px; outline: none; background: transparent; }
  .chart-name-input:hover, .chart-name-input:focus { border-bottom-color: var(--border); }
  .chart-werkzeuge { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
  .chart-werkzeug { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
  .chart-werkzeug:hover { border-color: var(--accent, #2563eb); color: var(--accent, #2563eb); }
  .chart-werkzeug.gesetzt { background: #ecfdf5; border-color: #a7f3d0; }
  .chart-werkzeug.fehlt { background: #fffbeb; border-color: #fcd34d; }
  .chart-werkzeug-trenner { flex: 1; }
  .chart-vorschau { max-height: 380px; }
  .chart-vorschau td.leer-zeile { color: transparent; font-style: normal; height: 26px; }
  .chart-popover { position: fixed; z-index: 1200; width: 420px; max-width: 95vw; background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.22); padding: 14px 16px 12px; font-size: 12.5px; max-height: 80vh; overflow: auto; }
  .chart-popover.breit { width: 560px; }
  .chart-popover label { display: block; font-size: 11.5px; color: var(--muted); margin: 8px 0 3px; }
  .chart-popover label:first-child { margin-top: 0; }
  .chart-popover input[type="text"], .chart-popover textarea, .chart-popover select {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 12.5px; background: #f8fafc; }
  .chart-popover input[type="text"]:focus, .chart-popover textarea:focus, .chart-popover select:focus { background: #fff; outline: 2px solid #bfdbfe; }
  .chart-popover .format-pillen { display: flex; flex-wrap: wrap; gap: 4px; }
  .chart-popover .format-pille { border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; cursor: pointer; font-size: 12px; background: #fff; }
  .chart-popover .format-pille.aktiv { background: #1f2937; color: #fff; border-color: #1f2937; }
  .chart-popover .popover-mehr { margin-top: 8px; font-size: 12px; color: var(--accent, #2563eb); cursor: pointer; user-select: none; }
  .chart-popover .popover-mehr-inhalt { display: none; }
  .chart-popover .popover-mehr-inhalt.offen { display: block; }
  .chart-popover .popover-aktionen { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
  .chart-popover .popover-aktionen .links { margin-right: auto; }
  .chart-popover .popover-aktionen button { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
  .chart-popover .popover-aktionen button.primaer { background: #111827; color: #fff; border-color: #111827; }
  .chart-popover .popover-aktionen button.gefahr { color: #b91c1c; border: none; }
  .chart-popover .skill-cat-select { margin: 4px 0 0; padding: 6px 8px; }
  .chart-popover .chart-je-dok { margin-top: 8px; }
  .chart-detail-felder { display: grid; grid-template-columns: 1fr 180px 170px 220px; gap: 8px; align-items: end; }
  .chart-detail-felder.gruppe { grid-template-columns: 1fr 260px auto; }
  .chart-detail-felder label { display: block; font-size: 11.5px; color: var(--muted); margin: 0 0 3px; }
  .chart-detail-felder input[type="text"], .chart-detail-felder select, .chart-detail-auftrag textarea {
    width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; }
  .chart-detail-auftrag { margin-top: 8px; }
  .chart-detail-aktionen { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
  .chart-detail-aktionen .chart-hint { margin-left: auto; }
  .chart-detail-leer { color: var(--muted); font-size: 12.5px; padding: 4px 0; }
  .chart-anwenden-vorschau { font-size: 12px; color: var(--muted); margin: 6px 0 4px; line-height: 1.5; }
  .chart-dok-kopf { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
  .chart-dok-kopf select { border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; max-width: 220px; }
  .chart-dok-kopf .skills-search-input { flex: 1; }
  .chart-dok-liste { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; margin-top: 4px; }
  .chart-dok-liste label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 2px 0; cursor: pointer; }
  .chart-dok-liste label small { color: var(--muted); }
  .chart-selector-wrap { position: relative; display: inline-block; }
  .chart-selector-wrap .skill-selector-menu { left: 0; }
  .skill-row-chart-badge { font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 5px; }
  .zeile-loeschen { border: none; background: none; cursor: pointer; font-size: 11px; opacity: 0; padding: 0; }
  .tabellen-raster tr:hover .zeile-loeschen { opacity: .5; }
  .zeile-loeschen:hover { opacity: 1 !important; }
  .tabellen-leer { padding: 24px 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }

  
  .akte-edit-wrap { position: relative; }
  .akte-edit-menu { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); min-width: 300px; z-index: 40; padding: 4px 0; }
  .akte-edit-menu.open { display: block; }
  .akte-edit-item { padding: 8px 14px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
  .akte-edit-item:hover { background: #f0f4ff; }
  .modal-box h3 { margin: 0 0 4px; font-size: 15px; }
  .modal-box .sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
  .modal-box label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 4px; }
  .modal-box textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical; }
  .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
  .table-only-actions { display: contents; }
  .table-only-actions.hidden { display: none; }
  .modal-actions button { padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
  .modal-actions .cancel { background: #fff; border: 1px solid var(--border); }
  .modal-actions .submit { background: var(--navy); color: #fff; border: none; }
  .match-yes { color: #15803d; font-weight: 600; }
  .match-partial { color: #b45309; font-weight: 600; }
  .match-no { color: #b91c1c; font-weight: 600; }
  .upload-btn { font-size: 11.5px; color: var(--accent); cursor: pointer; border: 1px solid var(--border); padding: 4px 8px; border-radius: 999px; }
  .chat-action-btn { font-size: 12.5px; font-weight: 600; color: #15803d; cursor: pointer; border: 1px solid #15803d; background: #fff; padding: 7px 12px; border-radius: 999px; }
  .chat-action-btn:hover { background: #f0fdf4; }
  .upload-btn:hover { background: #f0f4ff; }
  .upload-status { font-size: 11.5px; color: var(--muted); min-height: 15px; margin-top: 3px; }
  .upload-status.error { color: #b91c1c; }
  .upload-status.ok { color: #15803d; }
