
  :root{
    --blue-dark:#2C5F94; --blue:#3878B8; --blue-light:#20A8E0; --blue-pale:#EAF3FB;
    --orange:#F09000; --orange-light:#FFE7C2;
    --ink:#1F3348; --ink-dim:#5C7286; --line:#CBD9E6;
    --ok:#2FA36A; --bad:#E0554D; --gold:#C99A2E;
    --sticky-offset: 78px;
    --board-max: min(2000px, 98%);
  }
  *{ box-sizing:border-box; }
  html,body{
    margin:0; padding:0; min-height:100%;
    background:#F7FAFD; color:var(--ink);
    font-family:'Segoe UI', Roboto, -apple-system, sans-serif;
    -webkit-user-select:none; user-select:none;
    overscroll-behavior:none;
  }

  header{
    background:#fff; border-bottom:3px solid var(--blue);
    padding:14px 24px; display:flex; align-items:center; justify-content:space-between;
    flex-wrap:wrap; gap:12px; position:sticky; top:0; z-index:50;
  }
  .brand{ display:flex; align-items:center; gap:14px; }
  .brand img{ height:44px; }
  .brand-text h1{ margin:0; font-size:clamp(16px,2vw,22px); color:var(--blue-dark); }
  .brand-text .sub{ color:var(--ink-dim); font-size:12.5px; margin-top:2px; }

  .tabs{ display:flex; gap:6px; }
  .tab{
    padding:9px 16px; border-radius:10px; border:1.5px solid var(--blue);
    background:#fff; color:var(--blue-dark); font-weight:700; font-size:13.5px;
    cursor:pointer;
  }
  .tab.active{ background:var(--blue); color:#fff; }

  .controls{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  button{
    font-family:inherit; font-size:13px; padding:8px 14px; border-radius:10px;
    border:1.5px solid var(--blue); background:#fff; color:var(--blue-dark);
    font-weight:600; cursor:pointer; touch-action:manipulation;
  }
  button:active{ transform:scale(0.96); }
  button.primary{ background:var(--orange); border-color:var(--orange); color:#fff; }
  /* Knopf, der etwas wegnimmt: rot gefüllt, damit er sich vom blauen Weiter unterscheidet. */
  .modal-actions button.danger{ background:var(--bad); border-color:var(--bad); color:#fff; }
  button.ghost{ border-color:var(--line); color:var(--ink-dim); }
  button.small{ padding:6px 10px; font-size:12px; }
  /* Kein Wischen auf diesen Knoepfen: sonst deutet der Browser einen Tipp
     mit minimaler Fingerbewegung als Scrollen und verschluckt den Klick. */
  .collect-btn, .card-menu, .grp-caret{ touch-action:none; }
  /* Säulen-Farben sind eingeschaltet: der Schalter zeigt das deutlich an. */
  button.hint-btn.on, button.edit3-btn.on{ border-color:var(--blue); color:var(--blue-dark); background:var(--blue-pale); font-weight:700; }

  .size-box{
    display:flex; align-items:center; gap:6px; background:#fff;
    border:1.5px solid var(--line); border-radius:10px; padding:6px 10px;
  }
  .size-box label{ font-size:12px; color:var(--ink-dim); font-weight:600; }

  /* ---- zentrales Standortfeld ---- */
  #standortBar{
    background:linear-gradient(135deg, var(--blue-pale), #fff);
    border-bottom:2px solid var(--blue-light);
    padding:14px 24px; display:flex; align-items:center; justify-content:center;
    gap:12px; flex-wrap:wrap;
  }
  #standortBar label{ font-weight:700; color:var(--blue-dark); font-size:15px; }
  #standortName{ font-size:17px; font-weight:800; color:var(--ink); padding:6px 14px; border-radius:10px; border:2px solid var(--blue); background:#fff; }
  #standortBar a{ font-size:12.5px; color:var(--blue); font-weight:600; text-decoration:none; }
  #standortBar a:hover{ text-decoration:underline; }
  #saveStatus.warn{ color:var(--bad); font-weight:700; }
  #standortInput{
    font-family:inherit; font-size:17px; font-weight:700; color:var(--ink);
    padding:10px 16px; border-radius:10px; border:2px solid var(--blue);
    width:260px; text-align:center; outline:none;
  }
  #saveStatus{ font-size:12px; color:var(--ink-dim); min-width:180px; }

  /* ---- Vollbild-Modus: reduzierte Ansicht ---- */
  body.app-fullscreen .controls{ display:none !important; }
    body.app-fullscreen #standortBar{
    padding:10px 24px; gap:8px;
  }
  body.app-fullscreen #standortSaveBtn,
  body.app-fullscreen #saveStatus{ display:none !important; }
  body.app-fullscreen #standortInput{
    border-color:transparent; background:transparent; cursor:default;
  }
  #fsExitBtn{
    /* Sitzt in der Kopfzeile an der Stelle des Vollbild-Knopfes, nicht schwebend:
       so kann er die Schritt-Reiter nicht mehr ueberdecken. */
    display:none;
    align-items:center; gap:6px; font-size:13px; font-weight:700;
    padding:9px 16px; border-radius:999px; border:1.5px solid var(--blue);
    background:#fff; color:var(--blue-dark); cursor:pointer;
    flex:0 0 auto;
  }
  #fsExitBtn:active{ transform:scale(0.96); }
  body.app-fullscreen #fsExitBtn{ display:inline-flex; }

  /* ---- Personen-Leiste ---- */
  #peopleBarWrap{
    background:var(--blue-pale); border-bottom:2px solid var(--blue-light);
    padding:8px 24px 6px; position:sticky; top:var(--header-h, 78px); z-index:45;
  }
  #peopleBarHint{ font-size:11px; color:var(--ink-dim); text-align:center; margin-top:5px; }
  body.app-fullscreen #peopleBarHint{ display:none; }
  #peopleBarLabel{
    font-size:11.5px; letter-spacing:0.5px; text-transform:uppercase;
    color:var(--blue-dark); font-weight:700; margin:0 auto 6px auto; max-width:1400px; text-align:center;
  }
  #peopleBar{ display:flex; gap:8px; flex-wrap:wrap; min-height:38px; max-width:1500px; margin:0 auto; justify-content:center; }
  .person-chip.hover{ outline:3px solid var(--orange); outline-offset:2px; transform:scale(1.06); }
  .person-chip{
    display:flex; align-items:center; gap:6px;
    color:#fff; padding:7px 12px 7px 10px; border-radius:999px;
    font-size:13px; font-weight:700; cursor:grab; touch-action:none;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
  }
  .person-chip .badge{
    background:rgba(255,255,255,0.35); border-radius:999px;
    font-size:11px; padding:1px 7px; font-weight:700;
  }
  #peopleBar:empty::after{
    content:"Noch keine Personen angelegt – wechsle zu Level 1.";
    color:var(--ink-dim); font-size:13px; font-style:italic;
  }

  #scaleWrap{ transform-origin: top center; }
  main{ padding-bottom:24px; }
  .level{ display:none; }
  .level.active{ display:block; }

  /* ---- Level 1 ---- */
  #setupRow{
    margin:12px auto 6px auto; max-width:var(--board-max); display:flex; align-items:center; gap:10px;
    flex-wrap:wrap; background:#fff; border:1.5px solid var(--line); border-radius:12px;
    padding:10px 16px;
  }
  #setupRow input[type=number]{
    width:70px; padding:8px; border-radius:8px; border:1.5px solid var(--line);
    font-family:inherit; font-size:14px;
  }
  #setupRow label{ font-size:13.5px; font-weight:600; color:var(--ink-dim); }

  /* Personenspalten sind so breit wie die Saeulen in Schritt 2. Passen nicht
     genug Personen in eine Reihe auf, stehen sie mittig statt links - sonst
     klafft rechts eine Luecke, sobald jemand entfernt wird. Gleiches gilt fuer
     die letzte Reihe, wenn es mehr Personen als Spalten gibt. */
  #personCards{
    display:flex; flex-wrap:wrap; justify-content:center; align-items:stretch; gap:10px;
    margin:10px auto; max-width:var(--board-max);
  }
  #personCards > .person-card{ flex:0 0 calc((100% - (var(--cols,6) - 1) * 10px) / var(--cols,6)); }
  @media (max-width:1400px){ #personCards > .person-card{ flex-basis:calc((100% - 20px) / 3) !important; } }
  @media (max-width:1100px){ #personCards > .person-card{ flex-basis:calc((100% - 10px) / 2) !important; } }
  @media (max-width:640px){ #personCards > .person-card{ flex-basis:100% !important; } }
  .card-count{ background:rgba(255,255,255,0.3); color:#fff; border-radius:999px; font-size:11.5px; font-weight:800; padding:2px 8px; margin-left:6px; }
  .person-card{
    background:#fff; border-radius:14px; border:1.5px solid var(--line);
    box-shadow:0 3px 10px rgba(44,95,148,0.08);
  }
  .person-card-head{
    padding:10px 40px 10px 12px; display:flex; align-items:center; gap:8px; color:#fff;
    position:sticky; top:var(--sticky-offset); z-index:6;
    border-radius:14px 14px 0 0;
  }
  .person-card-head::after{
    content:''; position:absolute; top:50%; right:10px; transform:translateY(-50%);
    width:20px; height:20px; background-image:url('/img/icon.png');
    background-size:contain; background-repeat:no-repeat; opacity:0.55;
  }
  .person-card-head input{
    border:none; background:rgba(255,255,255,0.25); border-radius:6px;
    padding:5px 8px; color:#fff; font-weight:700; font-size:13.5px; width:100%;
    outline:none;
  }
  .person-card-head input::placeholder{ color:rgba(255,255,255,0.8); }
  /* Mini-Profil unter dem Namen: Funktion und Wochenstunden. */
  .person-meta{
    display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px;
    padding:5px 10px; font-size:12px; background:#F7FAFD; border-bottom:1px solid var(--line);
  }
  .person-meta .fn{ font-weight:700; color:var(--ink); }
  .person-meta .std{ margin-left:auto; color:var(--ink-dim); white-space:nowrap; }
  .person-fields{ display:flex; gap:8px; margin-bottom:6px; }
  .person-fields input{
    flex:1; min-height:44px; padding:8px 12px; border-radius:12px; border:1.5px solid var(--line);
    font-size:15px; font-family:inherit; color:var(--ink); background:#fff;
  }
  .person-fields input:focus{ outline:none; border-color:var(--blue); }
  .person-fields input.std-in{ flex:0 0 120px; }
  /* Aufgabenliste im Steckbrief: kompakt, damit auch 25 Aufgaben lesbar bleiben. */
  .person-tasks{ margin:2px 0 10px; font-size:13.5px; }
  .person-tasks .pt-grp{ font-size:10.5px; text-transform:uppercase; letter-spacing:.4px; font-weight:800; margin:8px 0 3px; }
  .person-tasks .pt-row{ display:flex; align-items:center; gap:8px; padding:3px 2px; }
  .person-tasks .pt-row .dot{ width:8px; height:8px; border-radius:50%; background:var(--line); flex:none; }
  .person-tasks .pt-row .tx{ flex:1; }
  .person-tasks .pt-row .v{ font-size:10px; font-weight:800; background:var(--ink-dim); color:#fff; border-radius:999px; padding:1px 6px; flex:none; }
  .person-tasks .pt-leer{ color:var(--ink-dim); font-style:italic; }
  .person-drop{
    min-height:70px; padding:10px; display:flex; flex-direction:column; align-items:stretch; gap:6px; flex:none;
    border-radius:0 0 14px 14px;
  }
  .person-drop:empty::after{
    content:"Aufgaben hierher ziehen"; font-size:12px; color:var(--ink-dim);
    border:2px dashed var(--line); border-radius:8px; padding:12px; text-align:center;
    display:block;
  }

  #pool1-wrap, #pool2-wrap{
    margin:10px auto; max-width:var(--board-max); background:var(--blue-pale); border:2px dashed var(--blue-light);
    border-radius:14px; padding:12px 14px;
  }
  #pool1-wrap .pool-label, #pool2-wrap .pool-label{
    font-size:11.5px; text-transform:uppercase; letter-spacing:0.5px;
    font-weight:700; color:var(--blue-dark); margin-bottom:8px;
  }
  #pool1, #pool2{
    display:block; min-height:50px;
    padding:0; background:transparent; border-top:none; border-radius:0; flex:none;
  }
  .pool-group{ margin-bottom:10px; padding:8px 8px 8px 10px; border-radius:10px; border-left:5px solid var(--line); }
  .pool-group-head{ font-size:11px; text-transform:uppercase; letter-spacing:.5px; font-weight:800; margin:0 0 6px 0; }
  .pool-group-chips{ display:flex; flex-wrap:wrap; gap:8px; }
  .pool-empty{ color:var(--ink-dim); font-size:13px; font-style:italic; padding:6px 2px; }
  .pool-search{
    font-family:inherit; font-size:13px; padding:7px 10px; border-radius:999px; border:1.5px solid var(--line);
    min-width:160px; flex:1; max-width:280px; outline:none; background:#fff;
  }
  .pool-search:focus{ border-color:var(--blue); }
  .search-hide{ display:none !important; }
  /* Säulenfilter: alles ausblenden, was nicht zur gewählten Säule gehört. */
  .dept-hide{ display:none !important; }

  /* ---- "+ Aufgabe hinzufügen" ---- */
  .add-task-btn{
    display:inline-flex; align-items:center; gap:4px;
    font-size:12px; font-weight:700; padding:6px 12px; border-radius:999px;
    border:1.5px dashed var(--orange); background:#fff; color:var(--orange);
    cursor:pointer; touch-action:manipulation; white-space:nowrap;
  }
  .add-task-btn:active{ transform:scale(0.96); }
  .pool-label-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
  .pool-label-row .pool-label{ margin-bottom:0; }
  #board2 .dropzone[data-kind="dept"]{ border-radius:0; }
  .col-add-row{
    padding:8px 14px 12px 14px; background:#FCFEFF; border-radius:0 0 14px 14px;
    display:flex; justify-content:center;
  }

  /* ---- Ein- und ausklappbare Gruppen ----
     Bewusst kein overflow-y in Schritt 1 und 2: attachDrag scrollt beim Ziehen
     nicht mit, ein Ziel unter der Kante waere sonst nicht erreichbar.
     In Schritt 3 wird nicht gezogen, dort ist eine Maximalhoehe gefahrlos. */
  .grp-head{ display:flex; align-items:center; gap:6px; cursor:pointer; }
  .grp-caret{ font-size:10px; line-height:1; opacity:.75; flex:0 0 auto; }
  button.grp-caret{
    border:none; background:rgba(255,255,255,.28); color:inherit;
    padding:0; margin:0; width:22px; height:22px; border-radius:50%;
    font-size:11px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  }
  .col-head.grp-head{ justify-content:center; }
  .col-head.grp-head button.grp-caret{ position:absolute; left:10px; top:50%; transform:translateY(-50%); }
  /* Personenkarten in Schritt 1: der Pfeil bleibt in der Zeile, sonst liegt er auf dem Namensfeld. */
  .col-head.person-card-head.grp-head{ justify-content:flex-start; }
  .col-head.person-card-head.grp-head button.grp-caret{ position:static; transform:none; }
  .col-head.grp-head{ position:sticky; }
  .grp-box.collapsed > .grp-body{ display:none !important; }
  .column.collapsed{ min-height:0; }
  .column.collapsed .col-head{ border-radius:14px 14px 0 0; }
  .grp-box.collapsed > .grp-head{ margin-bottom:0; }

  /* ---- Chips ---- */
  .chip{
    background:#fff; border:1.5px solid var(--blue-light); border-radius:10px;
    padding:10px 30px 10px 12px; font-size:13.5px; line-height:1.3; color:var(--ink);
    cursor:grab; touch-action:none; box-shadow:0 2px 6px rgba(44,95,148,0.1);
    max-width:260px; position:relative; border-left-width:5px; min-height:44px; display:flex; align-items:center; flex-wrap:wrap; gap:2px 4px;
  }
  /* Ist die Aufgabe einer Person oder Säule zugeordnet, steht sie auf voller
     Breite untereinander. Nur im Pool bleiben die Kärtchen schmal und brechen
     um - dort hilft das beim Überfliegen. */
  .person-drop > .chip,
  .card-group-chips > .chip,
  .dropzone > .chip,
  .org-team .grp-tasks > .chip{ max-width:none; width:100%; }
  .chip.sub-task{ background:#FBFCFE; border-style:dashed; }
  .chip.sub-task.custom-task{ border-color:var(--orange); }
  .role-tag{
    position:absolute; bottom:5px; right:6px; width:18px; height:18px; border-radius:50%;
    background:var(--ink-dim); color:#fff; font-size:10.5px; font-weight:800;
    display:inline-flex; align-items:center; justify-content:center;
  }
  .chip.no-sub{ box-shadow:0 0 0 2px var(--bad) inset; background:#FDF1F0; }
  .chip.no-sub::before{ content:'ohne Vertretung'; position:absolute; top:-8px; right:8px; font-size:9px; font-weight:800; color:#fff; background:var(--bad); border-radius:6px; padding:1px 6px; }
  .chip.custom-task{ border-style:dashed; border-color:var(--orange); }
  .chip::after{
    content:''; position:absolute; top:6px; right:6px; width:16px; height:16px;
    background-image:url('/img/icon.png'); background-size:contain; background-repeat:no-repeat;
    opacity:0.25; pointer-events:none;
  }
  .chip .person-tag{
    display:inline-block; font-size:10.5px; font-weight:700; color:#fff;
    border-radius:6px; padding:1px 6px; margin-right:6px;
  }
  .chip .chef-tag{
    display:inline-block; font-size:10px; font-weight:800; color:#fff;
    background:var(--gold); border-radius:6px; padding:1px 6px; margin-right:6px;
  }
  .chip.correct{ border-color:var(--ok); box-shadow:0 0 0 2px var(--ok) inset; background:#F1FBF5; }
  .chip.incorrect{ border-color:var(--bad); box-shadow:0 0 0 2px var(--bad) inset; background:#FDF1F0; }
  .dragging-ghost{ opacity:0.95 !important; }

  .chip-btn.dup{
    position:absolute; top:6px; left:6px; width:26px; height:26px; border-radius:50%;
    border:none; cursor:pointer; font-size:16px; font-weight:800; line-height:1;
    display:flex; align-items:center; justify-content:center; color:#fff; padding:0;
    touch-action:manipulation; background:var(--blue);
  }
  .chip-btn.del{
    position:absolute; bottom:6px; left:7px; width:18px; height:18px; border-radius:50%;
    border:none; cursor:pointer; font-size:12px; font-weight:800; line-height:1;
    display:flex; align-items:center; justify-content:center; color:#fff; padding:0;
    touch-action:manipulation; background:var(--bad);
  }

  /* ---- Level 2 board ---- */
  #board2{
    display:grid; grid-template-columns:repeat(var(--cols,6),1fr); gap:10px; margin:10px auto; max-width:var(--board-max);
  }
  @media (max-width:1400px){ #board2, #board3, #pool3Row{ grid-template-columns:repeat(3,1fr) !important; } }
  @media (max-width:1100px){ #board2, #board3, #pool3Row{ grid-template-columns:repeat(2,1fr) !important; } }
  @media (max-width:640px){ #board2, #board3, #pool3Row{ grid-template-columns:1fr !important; } }
  /* Nur eine Säule gewählt: die eine Spalte nimmt die ganze Breite. */
  #board2.dept-filtered{ grid-template-columns:1fr !important; }

  .column{
    background:#fff; border-radius:14px; border:1.5px solid var(--line);
    min-height:280px; box-shadow:0 3px 10px rgba(44,95,148,0.08);
    display:flex; flex-direction:column;
  }
  .col-head{
    padding:12px 14px; font-weight:700; font-size:15px; color:#fff; text-align:center;
    background:linear-gradient(135deg,var(--blue),var(--blue-dark));
    position:sticky; top:var(--sticky-offset); z-index:6;
    border-radius:14px 14px 0 0;
  }
  .col-head::after{
    content:''; position:absolute; top:50%; right:12px; transform:translateY(-50%);
    width:20px; height:20px; background-image:url('/img/icon.png');
    background-size:contain; background-repeat:no-repeat; opacity:0.55;
  }
  .dropzone{
    flex:1; padding:12px; display:flex; flex-direction:column; align-items:stretch; gap:8px;
    background:#FCFEFF; border-top:4px solid var(--orange); min-height:220px;
    position:relative; border-radius:0 0 14px 14px;
  }
  .dropzone.hover{ background:var(--orange-light); }
  .dropzone.hover::before{
    content:'+'; position:absolute; top:6px; right:6px; width:24px; height:24px;
    border-radius:50%; background:var(--orange); color:#fff; font-weight:800; font-size:16px;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 3px 8px rgba(0,0,0,0.25); z-index:5;
  }
  .dropzone:empty::after{
    content:"Hier ablegen"; display:block; text-align:center; color:var(--ink-dim);
    font-size:12.5px; border:2px dashed var(--line); border-radius:10px; padding:16px 6px;
  }

  /* ---- Level 3 ---- */
  #chefWrap{ margin:10px auto 0 auto; max-width:1400px; }
  #chefWrap .col-head{ background:linear-gradient(135deg, var(--gold), #8f6c1c); border-radius:14px 14px 0 0; }
  #chefWrap .column{ min-height:auto; }
  #chefPool{
    flex-direction:row !important; flex-wrap:wrap; min-height:64px; border-top:4px solid var(--gold);
  }

  #pool3Row{
    display:grid; grid-template-columns:repeat(var(--cols,6),1fr); gap:10px; margin:10px auto 0 auto; max-width:1400px;
  }
  .pool3-box{
    background:var(--blue-pale); border:2px dashed var(--blue-light); border-radius:14px; padding:10px;
  }
  .pool3-box .pool-label{
    font-size:11px; text-transform:uppercase; letter-spacing:0.4px; font-weight:700; color:var(--blue-dark); margin-bottom:8px;
  }

  #board3{ display:grid; grid-template-columns:repeat(var(--cols,6),1fr); gap:10px; margin:10px auto; max-width:1400px; }
  .col3-body{ padding:10px; display:flex; flex-direction:column; gap:10px; min-height:220px; background:#FCFEFF; border-radius:0 0 14px 14px; }
  .pool3-label, .clusters-label{
    font-size:10.5px; text-transform:uppercase; letter-spacing:0.4px; color:var(--ink-dim); font-weight:700;
  }
  .pool3{ display:flex; flex-flow:row wrap; flex:none; min-height:40px; padding:0; gap:8px; }
  .pool3:empty::after{ content:"leer"; color:var(--ink-dim); font-size:12px; font-style:italic; }
  .cluster{
    border-radius:12px; padding:8px; border:2px solid; background:#fff; position:relative;
    display:flex; flex-direction:column; flex:none; min-height:0;
  }
  .cluster .cluster-head{
    display:flex; align-items:center; justify-content:space-between; margin-bottom:6px;
  }
  .cluster .cluster-name{
    font-size:11.5px; font-weight:800; color:#fff; border-radius:6px;
    padding:2px 8px; display:flex; align-items:center; gap:6px; cursor:grab; touch-action:none;
  }
  .cluster .cluster-name .grip{ font-size:12px; opacity:0.85; }
  .cluster .cluster-remove{
    border:none; background:transparent; color:var(--ink-dim); font-size:15px; cursor:pointer; padding:0 4px;
  }
  .cluster-chips{ display:flex; flex-flow:row wrap; gap:8px; }
  .cluster .chip{ margin-bottom:0; }
  .add-person-row{ display:flex; gap:6px; align-items:center; }
  .add-person-row select{
    flex:1; font-family:inherit; font-size:12px; padding:6px; border-radius:8px; border:1.5px solid var(--line);
  }
  .empty-col3{ color:var(--ink-dim); font-size:12.5px; font-style:italic; text-align:center; padding:10px 6px; }

  footer{
    padding:14px 24px 26px; text-align:center; color:var(--ink-dim); font-size:12px;
    display:flex; align-items:center; justify-content:center; gap:10px;
  }
  footer img{ height:20px; opacity:0.7; }

  #importFileInput{ display:none; }

  #printTitle{ display:none; }

  @media print{
    header, #standortBar, #peopleBarWrap, #lastResult, .chip-btn, .info-dot,
    .chip::after, .col-head::after, .person-card-head::after,
    .modal-overlay, #taskInfoPanel, .add-person-row, .cluster-remove,
    .add-task-btn, .col-add-row{
      display:none !important;
    }
    #scaleWrap{ zoom:1 !important; }
    #printTitle{
      display:block; padding:14px 24px 4px 24px; color:var(--blue-dark);
    }
    #printTitle h2{ margin:0 0 2px 0; font-size:20px; }
    #printTitle .print-sub{ font-size:12px; color:var(--ink-dim); }
    .level{ display:block !important; page-break-after:always; }
    .level:last-child{ page-break-after:auto; }
    .chip{ box-shadow:none; break-inside:avoid; }
    .column, .cluster, .person-card{ box-shadow:none; break-inside:avoid; }
    #board2, #board3, #pool3Row, #personCards{ break-inside:avoid; }

    /* ---- Ein-Seiten-Übersicht (Level 3, wie in der App) ---- */
    body.print-onepager{ zoom:1 !important; }
    @page{ size: 297mm 210mm; margin: 8mm; }
    body.print-onepager #level1,
    body.print-onepager #level2{ display:none !important; }
    body.print-onepager #level3{
      display:block !important;
      page-break-after:auto !important;
      break-after:auto !important;
    }
    body.print-onepager #printTitle{
      padding:4px 6px 4px 6px;
    }
    body.print-onepager #printTitle h2{ font-size:15px; }
    body.print-onepager #printTitle .print-sub{ font-size:9.5px; }
    body.print-onepager #scaleWrap{ transform:none !important; width:100% !important; }

    /* 5 Spalten erzwingen, unabhängig von Bildschirm-Breakpoints */
    body.print-onepager #board2,
    body.print-onepager #board3,
    body.print-onepager #pool3Row{
      grid-template-columns:repeat(var(--cols,6),1fr) !important;
      gap:6px !important;
      max-width:100% !important;
      margin:6px 0 !important;
    }
    body.print-onepager #chefWrap{ max-width:100% !important; margin:0 !important; }
    body.print-onepager .pool3-box .pool-label,
    body.print-onepager .pool-label{ font-size:9.5px; padding:4px 8px; }
    body.print-onepager .pool3-box{ padding:4px; }

    body.print-onepager .chip{
      font-size:10px; padding:4px 8px; border-radius:9px; min-height:0; margin-bottom:4px;
    }
    body.print-onepager .chip .chip-btn,
    body.print-onepager .chip .info-dot{ display:none !important; }
    body.print-onepager .col-head{ font-size:11.5px; padding:6px 10px; }
    body.print-onepager .person-card-head{ font-size:11px; padding:5px 8px; }
    body.print-onepager .person-meta{ font-size:9px; padding:2px 8px; }
    body.print-onepager .cluster-name{ font-size:10px; padding:4px 8px; }
    body.print-onepager .cluster{ margin-bottom:5px; border-radius:8px; }
    body.print-onepager .cluster-chips{ gap:4px; }
    body.print-onepager .column{ border-radius:8px; box-shadow:none; }
    body.print-onepager #chefPool{ padding:6px; gap:6px; }
    body.print-onepager #chefWrap .col-head{ font-size:12px; padding:7px 10px; }
    /* Kein erzwungenes Umbrechen mehr, damit alles dicht ineinander fließt statt große Lücken zu reißen */
    body.print-onepager .chip,
    body.print-onepager .column,
    body.print-onepager .cluster,
    body.print-onepager .person-card,
    body.print-onepager #board2,
    body.print-onepager #board3,
    body.print-onepager #pool3Row,
    body.print-onepager #personCards{
      break-inside:auto !important; page-break-inside:auto !important;
    }
  }

  /* ---- Bestätigungs-Modal ---- */
  .modal-overlay{
    display:none; position:fixed; inset:0; background:rgba(31,51,72,0.45);
    z-index:200; align-items:center; justify-content:center; padding:20px;
  }
  .modal-overlay.open{ display:flex; }
  .modal-box{
    background:#fff; border-radius:16px; padding:22px 24px; max-width:380px; width:100%;
    box-shadow:0 12px 32px rgba(0,0,0,0.25);
  }
  .modal-box h3{ margin:0 0 10px 0; color:var(--blue-dark); font-size:17px; }
  .modal-box p{ margin:0 0 18px 0; color:var(--ink-dim); font-size:13.5px; line-height:1.5; }
  .modal-actions{ display:flex; justify-content:flex-end; gap:10px; }
  .export-label-input{
    width:100%; padding:9px 10px; border:1.5px solid var(--line); border-radius:10px;
    font-family:inherit; font-size:14px; margin-bottom:16px; color:var(--ink);
  }

  /* ---- Steckbrief-Seitenpanel ---- */
  #taskInfoPanel{
    position:fixed; top:0; right:0; height:100vh; width:320px; max-width:88vw;
    background:#fff; box-shadow:-6px 0 24px rgba(31,51,72,0.18);
    border-left:1.5px solid var(--line);
    padding:20px 18px; z-index:150;
    transform:translateX(100%); transition:transform .22s ease;
    overflow-y:auto;
  }
  #taskInfoPanel.open{ transform:translateX(0); }
  #taskInfoClose{
    position:absolute; top:12px; right:12px; width:28px; height:28px; border-radius:50%;
    border:1.5px solid var(--line); background:#fff; color:var(--ink-dim); font-size:16px;
    padding:0; display:flex; align-items:center; justify-content:center;
  }
  .tip-eyebrow{
    font-size:11px; text-transform:uppercase; letter-spacing:0.6px; font-weight:700; color:var(--orange);
    margin-bottom:4px;
  }
  #taskInfoPanel h3{ margin:0 0 8px 0; color:var(--blue-dark); font-size:18px; padding-right:30px; line-height:1.3; }
  .tip-dept-tag{
    display:inline-block; background:var(--blue-pale); color:var(--blue-dark); font-size:11.5px;
    font-weight:700; border-radius:6px; padding:3px 9px; margin-bottom:16px;
  }
  .tip-label{
    display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:0.4px;
    font-weight:700; color:var(--ink-dim); margin:14px 0 6px 0;
  }
  #taskInfoPanel textarea, #taskInfoPanel input{
    width:100%; font-family:inherit; font-size:13.5px; color:var(--ink);
    border:1.5px solid var(--line); border-radius:10px; padding:9px 10px; resize:vertical;
  }
  .tip-actions{ display:flex; align-items:center; gap:12px; margin-top:14px; flex-wrap:wrap; }
  .tip-open-link{ font-size:13px; color:var(--blue); font-weight:600; text-decoration:none; }
  .tip-open-link:hover{ text-decoration:underline; }
  .tip-saved-note{ margin-top:8px; font-size:12px; color:var(--ok); font-weight:600; min-height:16px; }

  .chip .info-dot{
    position:absolute; bottom:6px; right:7px; width:15px; height:15px; border-radius:50%;
    background:var(--blue-pale); color:var(--blue-dark); font-size:10px; font-weight:800;
    display:flex; align-items:center; justify-content:center; pointer-events:none;
  }

  /* ---- Ergänzungen DB-Version ---- */
  .snap-list{ list-style:none; margin:0 0 14px 0; padding:0; max-height:260px; overflow-y:auto; }
  .snap-list li{ display:flex; align-items:center; gap:8px; padding:8px 4px; border-bottom:1px solid var(--line); font-size:13px; }
  .snap-list li .snap-label{ flex:1; font-weight:600; color:var(--ink); }
  .snap-list li .snap-date{ color:var(--ink-dim); font-size:11.5px; }
  .snap-list:empty::after{ content:"Noch keine gesicherten Stände."; color:var(--ink-dim); font-style:italic; font-size:13px; }
  .modal-box.wide{ max-width:520px; }
  /* Passt für vier Ziffern genauso wie für ein längeres Passwort. */
  /* Bewusst kein gesperrtes, zentriertes Feld mehr: das sah nach Zahlenschloss
     aus, obwohl ein Standort auch ein Passwort hinterlegen darf. Jetzt ein
     gewöhnliches Anmeldefeld - 16px, damit Tablets beim Tippen nicht zoomen. */
  .pin-label{ display:block; font-size:13px; font-weight:700; color:var(--blue-dark); margin-bottom:5px; }
  .pin-input{ font-size:16px; padding:11px 14px; margin-bottom:10px; }
  .pin-input:focus{ border-color:var(--blue); outline:none; }
  .pin-error{ color:var(--bad); font-size:12.5px; min-height:16px; margin-bottom:8px; }
  body.app-fullscreen #standortBar a{ display:none; }
  @media print{ #standortBar{ display:none !important; } }

  /* ---- Tabs mit Zähler ---- */
  .tab{ display:inline-flex; align-items:center; gap:6px; }
  .tab-badge{ display:none; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:var(--orange); color:#fff; font-size:11px; font-weight:800; }
  .tab.active .tab-badge{ background:#fff; color:var(--orange); }
  /* ---- Menüs im Kopf ---- */
  .menu-wrap{ position:relative; }
  .menu{ display:none; position:absolute; right:0; top:calc(100% + 6px); background:#fff; border:1.5px solid var(--line); border-radius:12px;
    box-shadow:0 10px 30px rgba(31,51,72,0.18); min-width:290px; padding:6px; z-index:300; flex-direction:column; }
  .menu.open{ display:flex; }
  .menu button{ border:none; background:transparent; text-align:left; padding:11px 12px; border-radius:8px; font-size:13.5px; font-weight:600; color:var(--ink); min-height:44px; }
  .menu button:hover{ background:var(--blue-pale); }
  .menu button.danger{ color:var(--bad); }
  .menu-sep{ height:1px; background:var(--line); margin:4px 6px; }
  #undoBtn:disabled{ opacity:.45; cursor:default; }
  /* ---- Schritt-3-Leiste ---- */
  /* ---- Einheitliche Werkzeugzeile in allen drei Schritten ----
     Gleiche Stelle, gleiche Optik: links die Bedienelemente, rechts der Hinweis.
     So muss man beim Wechsel zwischen den Schritten nichts suchen. */
  .level-toolbar{
    max-width:var(--board-max); margin:10px auto 0; padding:0 4px;
    display:flex; align-items:center; gap:16px; flex-wrap:wrap;
    min-height:44px;
  }
  .level-tools{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:0 0 auto; }
  .level-hint{ flex:1 1 260px; font-size:12px; color:var(--ink-dim); text-align:right; }
  .level-toolbar .toggle{ display:inline-flex; align-items:center; gap:8px; font-weight:700; color:var(--ink); cursor:pointer; min-height:44px; }
  .level-toolbar .toggle input{ width:20px; height:20px; }
  @media (max-width: 900px){
    .level-hint{ flex-basis:100%; text-align:left; }
  }
  /* ---- Aktionsmenü (Sheet) ---- */
  .modal-overlay.sheet{ align-items:flex-end; }
  .sheet-box{ background:#fff; border-radius:18px 18px 0 0; width:100%; max-width:560px; padding:18px 18px 22px; box-shadow:0 -10px 30px rgba(0,0,0,0.25); max-height:88vh; overflow-y:auto; }
  @media (min-width:700px){ .modal-overlay.sheet{ align-items:center; } .sheet-box{ border-radius:18px; } }
  .sheet-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:12px; }
  .sheet-head h3{ margin:2px 0 0; font-size:17px; color:var(--blue-dark); line-height:1.3; }
  .sheet-close{ width:40px; height:40px; border-radius:50%; border:1.5px solid var(--line); background:#fff; font-size:20px; padding:0; color:var(--ink-dim); flex:none; }
  .sheet-actions{ display:flex; flex-direction:column; gap:8px; }
  .sheet-btn{ min-height:48px; font-size:15px; text-align:left; padding:10px 16px; border-radius:12px; border:1.5px solid var(--line); background:#fff; color:var(--ink); }
  .sheet-btn:hover{ border-color:var(--blue); background:var(--blue-pale); }
  .sheet-btn.danger{ color:var(--bad); }
  .sheet-btn.ghostbtn{ color:var(--ink-dim); border-style:dashed; }
  .sheet-btn.person{ font-weight:800; }
  .sheet-btn:disabled{ opacity:.5; }
  .sheet-sub{ font-size:13px; color:var(--ink-dim); margin:2px 0 4px; }
  /* ---- Entfällt bei uns ---- */
  #entfallenWrap{ max-width:var(--board-max); margin:10px auto 0; }
  .pool-label.entfallen-label{ background:#EFEFEA; color:#5F5E5A; }
  #entfallenBox{
    background:#F7F7F4; border:1.5px solid #D3D1C7; border-top:none; border-radius:0 0 14px 14px;
    padding:8px 12px 12px; display:flex; flex-direction:column; gap:4px;
  }
  .entf-zeile{
    display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; cursor:pointer;
    padding:6px 8px; border-radius:8px; font-size:13px; min-height:36px;
  }
  .entf-zeile:hover{ background:#fff; }
  .entf-name{ font-weight:700; color:var(--ink-dim); text-decoration:line-through; }
  .entf-grund{ color:var(--ink-dim); font-size:12.5px; font-style:italic; }
  .chip.entfaellt{ opacity:.6; border-style:dashed; }
  .chip.entfaellt::first-line{ text-decoration:line-through; }

  /* ---- Zugang für Mitarbeiter ---- */
  .gast-status{ font-size:13px; padding:8px 12px; border-radius:10px; background:#FDF5E8; color:var(--orange); font-weight:600; margin-bottom:10px; }
  .gast-status.an{ background:#F1FBF5; color:var(--ok); }
  .gast-status.offen{ background:#FDF1F0; color:var(--bad); }
  .gast-text{
    width:100%; font-family:inherit; font-size:13px; line-height:1.5; color:var(--ink);
    border:1.5px solid var(--line); border-radius:10px; padding:10px 12px; resize:vertical; margin-bottom:8px;
  }
  #gastEinladung{ margin-top:4px; }

  /* ---- Steckbrief-Ansicht ---- */
  .tip-text{ font-size:13.5px; line-height:1.5; color:var(--ink); margin:0; white-space:pre-wrap; }
  .tip-muted{ font-size:12px; color:var(--ink-dim); margin-top:10px; display:block; }
  @media print{
    .tab-badge, #peopleBarHint, .level-toolbar, .role-tag{ display:none !important; }
    .chip{ border-left-width:4px !important; min-height:0 !important; display:block !important; }
  }
  /* ---- Geschäftsführung als eigener Bereich (Schritt 2 + 3) ---- */
  #board2Chef{ max-width:var(--board-max); margin:10px auto 0; }
  .chef-row{ min-height:auto; }
  .chef-row .col-head, #chefWrap .col-head{ background:linear-gradient(135deg, var(--gold), #8f6c1c) !important; }
  .chef-row .dropzone{ min-height:70px; border-top-color:var(--gold); border-radius:0; }
  .chef-row .col-add-row{ border-radius:0 0 14px 14px; }
  #chefWrap .column{ min-height:auto; }
  .chef-body{ display:flex; flex-wrap:wrap; gap:10px; padding:10px; align-items:flex-start; background:#FCFEFF; border-top:4px solid var(--gold); border-radius:0 0 14px 14px; }
  .chef-pool-box{ flex:1 1 300px; }
  #chefBody{ flex:2 1 420px; flex-direction:row; flex-wrap:wrap; align-items:flex-start; min-height:0; padding:0; background:transparent; }
  #chefBody .clusters-label{ width:100%; }
  #chefBody .cluster{ flex:0 1 auto; min-width:220px; }
  #chefBody .add-person-row{ align-self:flex-start; }
  /* ---- Schritt 3 als Organigramm: Verantwortliche je Säule, Verbindungslinien ---- */
  .col-lead{ padding:10px 12px 8px; background:#fff; border-bottom:1px solid var(--line); display:flex; flex-direction:column; gap:6px; }
  .chef-lead{ align-items:center; background:#FFFBF0; }
  .lead-badge{ display:inline-flex; align-items:center; gap:8px; align-self:center; color:#fff; font-weight:800; font-size:14px; padding:8px 16px; border-radius:999px; box-shadow:0 2px 6px rgba(0,0,0,.15); max-width:100%; }
  .chef-lead .lead-badge{ font-size:17px; padding:10px 22px; }
  .lead-badge.empty{ background:#fff; color:var(--bad); border:2px dashed var(--bad); box-shadow:none; font-size:12.5px; font-weight:700; }
  .lead-sub-badge{ background:#fff; color:var(--ink); font-size:11px; font-weight:800; border-radius:999px; padding:2px 8px; border:2px solid; }
  .lead-row{ display:flex; align-items:center; gap:6px; font-size:12px; }
  .lead-row.sub{ opacity:.85; }
  .lead-label{ color:var(--ink-dim); font-weight:700; min-width:88px; font-size:11px; text-transform:uppercase; letter-spacing:.3px; }
  .lead-select{ flex:1; font-family:inherit; font-size:12.5px; padding:6px 8px; border-radius:8px; border:1.5px solid var(--line); background:#fff; min-height:36px; }
  .chef-lead .lead-row{ width:min(100%, 420px); }
  .pool3-box.in-col{ margin:8px 8px 0; padding:8px; }
  .pool3-box.in-col .pool-label{ font-size:10.5px; }
  .org-col{ position:relative; }
  @media print{ .lead-select, .lead-row{ display:none !important; } .col-lead{ padding:4px 8px; } .lead-badge{ font-size:10.5px; padding:3px 10px; } .chef-lead .lead-badge{ font-size:12px; } }

  /* ---- Schritt 3: Organigramm ---- */
  #orgChef{ max-width:var(--board-max); margin:10px auto 0; }
  #orgBoard{ display:grid; grid-template-columns:repeat(var(--cols,6),1fr); gap:10px; max-width:var(--board-max); margin:10px auto; align-items:stretch; padding:0 4px; }
  @media (max-width:1400px){ #orgBoard{ grid-template-columns:repeat(3,1fr); } }
  @media (max-width:1100px){ #orgBoard{ grid-template-columns:repeat(2,1fr); } }
  @media (max-width:640px){ #orgBoard{ grid-template-columns:1fr; } }
  .org-box{ background:#fff; border:1.5px solid var(--line); border-radius:14px; box-shadow:0 3px 10px rgba(44,95,148,0.08); display:flex; flex-direction:column; }
  .org-head{ padding:10px 14px; color:#fff; font-weight:800; font-size:15px; text-align:center; background:var(--blue); }
  .org-gf .org-head{ background:linear-gradient(135deg, var(--gold), #8f6c1c); font-size:17px; }
  .org-lead{ padding:14px 14px 12px; text-align:center; cursor:pointer; border-bottom:1px solid var(--line); background:#FCFEFF; }
  .org-lead:hover{ background:var(--blue-pale); }
  .org-lead .name{ display:inline-block; font-size:16px; font-weight:800; color:#fff; padding:7px 18px; border-radius:999px; box-shadow:0 2px 6px rgba(0,0,0,.15); max-width:100%; }
  .org-gf .org-lead .name{ font-size:21px; padding:10px 26px; }
  .org-lead .name.empty{ background:#fff; color:var(--bad); border:2px dashed var(--bad); font-size:13px; box-shadow:none; }
  .org-lead .sub{ font-size:12px; color:var(--ink-dim); margin-top:7px; font-weight:600; }
  .org-team{ border-top:4px solid var(--orange); background:#FCFEFF; flex:1; padding:10px 12px 12px; display:flex; flex-direction:column; gap:2px; font-size:13px; }
  .org-team .lbl{ font-size:10.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--ink-dim); font-weight:800; margin-bottom:4px; }
  .org-team .muted{ color:var(--ink-dim); font-style:italic; font-size:12.5px; }
  /* Jede Zeile ist zugleich der Kopf der Aufgaben dieser Person. */
  .org-member{ display:flex; align-items:center; gap:8px; padding:4px 4px; border-radius:8px; }
  .org-member:hover{ background:var(--blue-pale); }
  .org-member.noperson{ color:var(--bad); }
  .org-member .dot{ width:12px; height:12px; border-radius:50%; flex:none; }
  .org-member.noperson .dot{ background:var(--bad); }
  .org-member .nm{ font-weight:700; }
  .org-member .cnt{ margin-left:auto; color:var(--ink-dim); font-size:12px; white-space:nowrap; }
  .org-warn{ padding:4px 14px 8px; font-size:12.5px; color:var(--bad); font-weight:700; display:flex; gap:8px; align-items:center; justify-content:space-between; }
  .org-warn button{ padding:4px 10px; font-size:12px; min-height:32px; }
  .org-note{ padding:0 14px 10px; font-size:12px; color:var(--orange); font-weight:700; }
  .org-grp{ margin-bottom:0; }
  .org-team .grp-tasks{ display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:4px 0 10px 20px; }
  /* Schritt 3 im Bearbeiten-Modus: eigene Ablageziele, damit die schwere
     Optik der Ablageflaechen aus Schritt 1 und 2 hier nicht stoert. */
  #level3.editing .org-team{ background:#FFFCF4; }
  #level3.editing .grp-tasks{ min-height:30px; border-radius:8px; }
  .org-drop.hover{ background:var(--orange-light); outline:2px dashed var(--orange); outline-offset:-2px; border-radius:8px; }
  .org-team .chip{ cursor:pointer; }
  #level3.editing .org-team .chip{ cursor:grab; }
  .org-team .chip:hover{ border-color:var(--blue); }
  .org-team .chip .nosub{ width:8px; height:8px; border-radius:50%; background:var(--bad); margin-left:auto; flex:none; }
  .org-team .chip.noperson{ border-color:var(--bad); border-style:dashed; color:var(--bad); }
  .org-rest{ max-width:var(--board-max); margin:12px auto; background:#FDF1F0; border:1.5px solid var(--bad); border-radius:12px; padding:10px 14px; display:flex; gap:12px; align-items:center; justify-content:center; font-size:13px; color:var(--bad); font-weight:700; }
  .lead-pick{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
  .lead-pick .pick{ min-height:44px; padding:8px 14px; border-radius:999px; border:2px solid var(--line); background:#fff; font-weight:700; font-size:14px; color:var(--ink); }
  .lead-pick .pick.selected{ color:#fff; }
  .lead-pick .pick.none{ border-style:dashed; color:var(--ink-dim); }
  .lead-pick .pick.none.selected{ background:var(--ink-dim); color:#fff; }
  /* ---- Kompakter Kopf: Standort im Titel ---- */
  .brand-text h1{ font-size:clamp(17px,2vw,22px); }
  .brand-text .sub{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
  .hdr-link{ color:var(--blue); font-weight:600; text-decoration:none; }
  .hdr-link:hover{ text-decoration:underline; }
  #saveStatus{ color:var(--ink-dim); min-width:0; }
  #saveStatus.warn{ color:var(--bad); font-weight:700; }
  #statsLine{ text-align:center; font-size:11px; color:var(--blue-dark); font-weight:700; letter-spacing:.3px; text-transform:uppercase; margin-top:5px; }
  #peopleBarWrap{ padding:6px 24px 5px; }
  #noticeBar{ max-width:var(--board-max); margin:8px auto 0; background:#FFF3E0; border:1.5px solid var(--orange); color:#7a4a00; border-radius:10px; padding:8px 14px; font-size:13px; font-weight:600; }
  /* ---- Säulenbalken je Person ---- */
  .dept-bar{ display:flex; height:6px; border-radius:999px; overflow:hidden; background:var(--blue-pale); }
  .dept-bar span{ display:block; height:100%; }
  .dept-bar.empty{ background:repeating-linear-gradient(90deg, #E3EBF3 0 6px, #F3F7FB 6px 12px); }
  .person-chip{ position:relative; flex-direction:column; align-items:stretch; gap:3px; padding:6px 40px 6px 12px; min-width:120px; }
  .person-chip .badge{ position:absolute; right:8px; top:7px; }
  .person-chip .dept-bar.mini{ height:4px; background:rgba(255,255,255,.35); }
  .person-card .dept-bar{ height:7px; border-radius:0; }
  /* ---- Personenkarten: Gruppen je Säule, Menü ---- */
  .card-group{ width:100%; margin-bottom:6px; padding:6px 6px 6px 8px; border-radius:8px; border-left:4px solid var(--line); }
  .card-group-head{ font-size:10px; text-transform:uppercase; letter-spacing:.4px; font-weight:800; margin:0 0 5px 0; }
  .card-group-chips{ display:flex; flex-direction:column; align-items:stretch; gap:6px; }
  .person-drop{ display:block; }
  /* 38 statt 30 Pixel und 6 Pixel Luft dazwischen: mit dem Finger traf man
     sonst zwischen die beiden Knoepfe und es passierte gar nichts. */
  .card-menu{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:38px; height:38px; border-radius:50%; border:none; background:rgba(255,255,255,.28); color:#fff; font-size:17px; font-weight:800; padding:0; z-index:2; }
  .person-card-head::after{ display:none; }
  .person-card-head{ padding-right:96px; }
  .color-pick{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
  .color-dot{ width:36px; height:36px; border-radius:50%; border:3px solid transparent; padding:0; cursor:pointer; }
  .color-dot.selected{ border-color:var(--ink); }
  #setupRow{ gap:8px; }
  .setup-or{ color:var(--ink-dim); font-size:12px; }
  /* ---- Pool-Filter, Säulenköpfe ---- */
  .pool-filter{ font-family:inherit; font-size:12.5px; padding:6px 8px; border-radius:999px; border:1.5px solid var(--line); background:#fff; }
  .dept-head{ cursor:pointer; }
  .dept-head:hover{ filter:brightness(1.08); }
  .org-head{ cursor:pointer; }
  .org-lead .sub.missing{ color:var(--bad); font-weight:700; }
  /* ---- Struktur-Check ---- */
  #strukturCheck{ max-width:var(--board-max); margin:12px auto 0; background:#fff; border:1.5px solid var(--line); border-radius:14px; padding:12px 14px; box-shadow:0 3px 10px rgba(44,95,148,0.08); }
  .sc-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
  .sc-title{ font-weight:800; color:var(--blue-dark); font-size:15px; }
  .sc-score{ font-size:12.5px; color:var(--ink-dim); font-weight:700; }
  .sc-hinweis{ font-size:12px; color:var(--ink-dim); line-height:1.45; margin:-2px 0 10px 0; }
  .sc-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:8px; }
  .sc-item{ display:flex; gap:10px; align-items:flex-start; padding:8px 10px; border-radius:10px; background:#F7FAFD; border:1.5px solid transparent; }
  .sc-item.clickable{ cursor:pointer; }
  .sc-item.clickable:hover{ border-color:var(--blue); }
  .sc-dot{ width:14px; height:14px; border-radius:50%; flex:none; margin-top:2px; }
  .sc-item.ok .sc-dot{ background:var(--ok); }
  .sc-item.warn .sc-dot{ background:var(--orange); }
  .sc-item.bad .sc-dot{ background:var(--bad); }
  .sc-label{ font-size:12.5px; font-weight:700; color:var(--ink); line-height:1.3; }
  .sc-value{ font-size:12px; color:var(--ink-dim); margin-top:2px; }
  .sc-item.bad .sc-value{ color:var(--bad); font-weight:700; }
  .sc-item.warn .sc-value{ color:#b06a00; font-weight:700; }
  /* ---- Leitfaden ---- */
  .modal-box.guide{ max-width:640px; }
  .guide-steps{ margin:0 0 14px; padding-left:0; list-style:none; counter-reset:gs; }
  .guide-steps li{ counter-increment:gs; display:grid; grid-template-columns:32px 1fr; gap:4px 10px; padding:8px 10px; border-radius:10px; cursor:pointer; border:1.5px solid var(--line); margin-bottom:6px; }
  .guide-steps li:hover{ border-color:var(--blue); background:var(--blue-pale); }
  .guide-steps li::before{ content:counter(gs); grid-row:span 2; width:30px; height:30px; border-radius:50%; background:var(--blue); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; }
  .guide-steps li.done::before{ content:'✓'; background:var(--ok); }
  .gs-head{ display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
  .gs-title{ font-weight:800; color:var(--blue-dark); font-size:14px; }
  .gs-status{ font-size:11.5px; color:var(--ink-dim); font-weight:700; white-space:nowrap; }
  .guide-steps li.done .gs-status{ color:var(--ok); }
  .gs-desc{ font-size:12.5px; color:var(--ink-dim); line-height:1.4; }
  .guide-tips{ font-size:12px; color:var(--ink-dim); line-height:1.5; background:#F7FAFD; border-radius:10px; padding:8px 10px; margin-bottom:10px; }
  .small-toggle{ font-size:12.5px; color:var(--ink-dim); display:inline-flex; align-items:center; gap:6px; }
  .sheet-text{ font-size:14px; line-height:1.5; color:var(--ink); background:#F7FAFD; border-radius:10px; padding:10px 12px; }
  @media print{
    #strukturCheck{ break-inside:avoid; }
    body.print-onepager #strukturCheck{ padding:6px 8px; margin:0 0 4px; }
    body.print-onepager .sc-grid{ grid-template-columns:repeat(4,1fr); gap:4px; }
    body.print-onepager .sc-label{ font-size:8.5px; }
    body.print-onepager .sc-value{ font-size:8px; }
    body.print-onepager .sc-title{ font-size:11px; }
    #noticeBar, #statsLine, .card-menu, .dept-bar, .pool-filter{ display:none !important; }
  }
  @media print{
    body.print-onepager #orgBoard{ grid-template-columns:repeat(var(--cols,6),1fr) !important; gap:6px !important; }
    body.print-onepager .org-team .grp-tasks{ display:flex !important; flex-flow:row wrap !important; gap:4px; padding:2px 0 5px 12px; }
    body.print-onepager .org-team .grp-tasks > .chip{ width:auto !important; max-width:260px !important; }
    body.print-onepager .org-head{ font-size:11.5px; padding:5px 8px; }
    body.print-onepager .org-lead{ padding:6px 8px 5px; }
    body.print-onepager .org-lead .name{ font-size:11px; padding:3px 10px; }
    body.print-onepager .org-gf .org-lead .name{ font-size:13px; }
    body.print-onepager .org-lead .sub{ font-size:9px; margin-top:3px; }
    body.print-onepager .org-team{ padding:5px 8px 4px; font-size:9.5px; gap:1px; }
    body.print-onepager .org-member{ padding:1px 2px; }
    body.print-onepager .org-member .cnt{ font-size:9px; }
    body.print-onepager .org-warn, body.print-onepager .org-note{ font-size:9px; padding:0 8px 4px; }
    body.print-onepager .org-warn button{ display:none; }
    body.print-onepager #orgChef{ margin:4px auto 0; }
    body.print-onepager .org-box{ border-radius:8px; box-shadow:none; }
  }
  .person-drop{ padding:8px; flex:1; }
  @media print{ .card-group, .pool-group{ background:transparent !important; } }

  /* ---- Sammeln: ein Ziel wählen, dann Aufgaben antippen ----
     Der Knopf sitzt im Kopf der Personenkarte bzw. der Säulenspalte, links
     neben dem "⋯". Ist er an, ist die ganze Spalte orange umrandet und oben
     steht die Leiste, die erklärt was ein Tipp jetzt tut. */
  .collect-btn{
    position:absolute; top:50%; transform:translateY(-50%); right:50px;
    width:38px; height:38px; border-radius:50%; border:none; padding:0; z-index:3;
    background:rgba(255,255,255,.28); color:#fff; font-size:17px; font-weight:800; line-height:1;
  }
  .dept-head .collect-btn{ right:44px; }
  .collect-btn.on{ background:#fff; color:var(--orange); box-shadow:0 0 0 3px rgba(255,255,255,.5); }
  .dept-head{ padding-right:88px; }
  #collectBar{
    max-width:var(--board-max); margin:8px auto 0; display:flex; align-items:center; gap:12px;
    background:#FFF3E0; border:1.5px solid var(--orange); color:#7a4a00;
    border-radius:10px; padding:8px 14px; font-size:13px; font-weight:600;
  }
  /* display:flex würde das hidden-Attribut übersteuern, deshalb ausdrücklich. */
  #collectBar[hidden]{ display:none; }
  #collectBar button{ margin-left:auto; flex:none; }
  .collect-target{ outline:3px solid var(--orange); outline-offset:3px; border-radius:16px; }
  body.collecting .chip{ cursor:copy; }
  /* Schon vergeben: bleibt an Ort und Stelle, damit die Liste nicht wegrutscht. */
  .chip.collected{ opacity:.5; background:var(--blue-pale); border-style:dashed; box-shadow:none; }
  @media print{ #collectBar{ display:none !important; } .collect-btn{ display:none !important; } }

  /* ---- Erklärmodus: Beschriftungen auf der echten Oberfläche ---- */
  #explainLayer{ position:absolute; left:0; top:0; width:100%; z-index:180; }
  #explainLayer[hidden]{ display:none; }
  .ex-panel{
    position:fixed; right:12px; top:12px; bottom:12px; width:320px; max-width:46vw; z-index:2;
    background:#fff; border-radius:14px; box-shadow:0 10px 30px rgba(31,51,72,.4);
    padding:14px 6px 12px 14px; display:flex; flex-direction:column;
  }
  .ex-panel-kopf{ font-weight:700; color:var(--blue-dark); font-size:15px; }
  .ex-panel-hinweis{ font-size:11.5px; color:var(--ink-dim); margin:3px 8px 8px 0; line-height:1.4; }
  .ex-liste{ list-style:none; margin:0; padding:0 8px 0 0; overflow:auto; flex:1; }
  .ex-liste li{
    position:relative; padding:7px 4px 7px 30px; border-top:1px solid var(--line);
    font-size:12px; line-height:1.45; color:var(--ink); cursor:pointer;
  }
  .ex-liste li:hover{ background:var(--blue-pale); border-radius:8px; }
  .ex-liste b{ display:block; color:var(--blue-dark); font-size:12.5px; margin-bottom:1px; }
  .ex-li-num{
    position:absolute; left:2px; top:8px; width:20px; height:20px; border-radius:50%;
    background:var(--orange); color:#fff; font-size:11px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
  }
  .ex-dim{ position:absolute; left:0; top:0; width:100%; height:100%; background:rgba(31,51,72,.55); }
  .ex-ring{ position:absolute; border:2px solid var(--orange); border-radius:10px; background:rgba(255,255,255,.18); box-shadow:0 0 0 2px rgba(255,255,255,.35); }
  .ex-num{
    position:absolute; left:-11px; top:-11px; width:22px; height:22px; border-radius:50%;
    background:var(--orange); color:#fff; font-size:12px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
  }
  button#explainBtn.on{ border-color:var(--orange); color:var(--orange); background:#FFF3E0; }
  @media print{ #explainLayer{ display:none !important; } }

  /* ---- Workshop abschließen ---- */
  #finishModal .modal-box{ max-height:calc(100vh - 40px); overflow:auto; }
  .finish-list{ list-style:none; margin:0 0 18px 0; padding:0; counter-reset:fin; }
  .finish-step{
    counter-increment:fin; position:relative; padding:12px 14px 12px 46px; margin-bottom:8px;
    border:1.5px solid var(--line); border-radius:12px; background:#fff;
  }
  .finish-step::before{
    content:counter(fin); position:absolute; left:12px; top:12px;
    width:24px; height:24px; border-radius:50%; background:var(--blue); color:#fff;
    font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center;
  }
  .finish-step.done{ background:#F2FAF6; border-color:var(--ok); }
  /* Der Struktur-Check ist kein abzuhakender Punkt, sondern ein Hinweis. */
  .finish-step.hinweis{ background:#F7FAFD; counter-increment:none; }
  .finish-step.hinweis::before{ content:"i"; background:var(--ink-dim); font-style:italic; }
  .finish-fuss{ font-size:12px; color:var(--ink-dim); margin:0 8px 10px 0; line-height:1.45; }
  .finish-step.done::before{ content:"¹3"; background:var(--ok); }
  .finish-head{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
  .finish-title{ font-weight:700; color:var(--blue-dark); font-size:14px; }
  .finish-status{ margin-left:auto; font-size:12px; color:var(--ink-dim); white-space:nowrap; }
  .finish-step.done .finish-status{ color:var(--ok); font-weight:600; }
  .finish-text{ font-size:12.5px; color:var(--ink-dim); line-height:1.45; margin:4px 0 8px 0; }
