/* ============================================================
   InfoBoard v3 — „Das echte Brett aus dem Flur — nur klüger."
   Fotorealistische Whiteboard-Metapher, rein in CSS (0 Bild-Assets).
   App-Chrome folgt den geteilten OSP-Tokens (/shared/dark-mode.css);
   die Tafel bleibt auch im Dark Mode hell (physisch authentisch).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden-Attribut gewinnt IMMER (auch gegen display:flex/grid-Regeln) */
[hidden] { display: none !important; }

:root {
  --blue:       var(--color-primary);
  --orange:     var(--color-accent);
  --radius:     10px;
  --transition: .22s cubic-bezier(.4, 0, .2, 1);
  --f-head:     'Montserrat', sans-serif;
  --f-body:     'Open Sans', sans-serif;
  --f-hand:     'Caveat', cursive;

  /* Papier-Noise (feTurbulence als statisches data-URI — nie als Live-Filter!) */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Magnete (an die echten Dom-Magnete vom Foto angelehnt) */
  --mag-blue:   #2a63b8; --mag-blue-d:   #173f80;
  --mag-red:    #d23b2a; --mag-red-d:    #8f1f14;
  --mag-yellow: #eec21e; --mag-yellow-d: #b08a08;
  --mag-green:  #3d9146; --mag-green-d:  #23632b;

  /* Wand & Tafel */
  --wall:        #e9e6e0;
  --wall-shade:  #d8d4cc;
  --tafel:       #f4f5f2;
  --papier:      #fffefb;
}

html.dark {
  --wall:       #151b28;
  --wall-shade: #0d1220;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* ── Login-Screen: ein angepinnter Zettel ──────────────────── */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 50% 30%, rgba(255,255,255,.5), transparent 70%),
    var(--noise),
    linear-gradient(165deg, var(--wall), var(--wall-shade));
}
html.dark .login-screen {
  background:
    radial-gradient(900px 500px at 50% 30%, rgba(56,120,190,.14), transparent 70%),
    var(--noise),
    linear-gradient(165deg, var(--wall), var(--wall-shade));
}
.login-note {
  position: relative;
  width: min(400px, calc(100vw - 40px));
  padding: 44px 36px 34px;
  text-align: center;
  background: linear-gradient(176deg, #fff 0%, #fbfaf6 70%, #f3f1ea 100%);
  background-image: var(--noise), linear-gradient(176deg, #fff 0%, #fbfaf6 70%, #f3f1ea 100%);
  border-radius: 2px;
  transform: rotate(-1.2deg);
  box-shadow:
    0 1px 1px rgba(0,0,0,.05), 0 2px 2px rgba(0,0,0,.05),
    0 4px 4px rgba(0,0,0,.06), 0 8px 10px rgba(0,0,0,.07),
    0 18px 34px rgba(0,0,0,.16);
  color: #1E293B;
}
.login-magnet { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); }
.login-logo { width: 74px; height: 74px; border-radius: 16px; margin: 0 auto 16px; display: block; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.login-title { font-family: var(--f-head); font-weight: 800; font-size: 1.7rem; color: #0B3556; letter-spacing: -.02em; }
.login-subtitle { font-size: .85rem; color: #5a6472; margin: 8px 0 22px; line-height: 1.5; }
.login-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-head); font-weight: 700; font-size: .92rem;
  color: #fff; background: var(--blue);
  border: 0; border-radius: var(--radius); padding: 12px 22px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,128,201,.35);
  transition: transform var(--transition), box-shadow var(--transition);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,128,201,.4); }
.login-hint { margin-top: 16px; font-size: .74rem; color: #8a93a0; }

/* ── App-Chrome: Kopfleiste ────────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 40;
}
.hdr-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hdr-home {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: var(--color-text-muted); border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.hdr-home:hover { background: var(--color-bg-light); color: var(--blue); }
.hdr-logo { width: 38px; height: 38px; border-radius: 9px; }
.hdr-titles h1 { font-family: var(--f-head); font-weight: 800; font-size: 1.18rem; color: var(--blue); line-height: 1.1; }
.hdr-sub { font-size: .7rem; color: var(--color-text-lighter); letter-spacing: .01em; }
.hdr-right { display: flex; align-items: center; gap: 8px; }
.hdr-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-head); font-weight: 700; font-size: .8rem;
  color: var(--color-text-muted); background: var(--color-bg-light);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer;
  transition: all var(--transition);
}
.hdr-btn:hover { color: var(--blue); border-color: var(--blue); }
.hdr-btn--accent { color: #fff; background: var(--blue); border-color: var(--blue); }
.hdr-btn--accent:hover { color: #fff; background: var(--color-primary-dark); }
.hdr-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  font-size: .68rem; font-weight: 700; color: #fff;
  background: var(--orange); border-radius: 10px;
  box-shadow: 0 2px 6px rgba(220,80,15,.45);
}
.hdr-icon {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: var(--color-text-muted); background: none;
  border: 1px solid var(--color-border); border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition);
}
.hdr-icon:hover { color: var(--blue); border-color: var(--blue); }
.hdr-user {
  font-size: .74rem; font-weight: 600; color: var(--color-text-muted);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Werkzeugleiste ───────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
}
.toolbar-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--f-head); font-weight: 600; font-size: .76rem;
  color: var(--color-text-muted); background: var(--color-bg-light);
  border: 1px solid var(--color-border); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.toolbar-search {
  display: flex; align-items: center; gap: 8px;
  color: var(--color-text-lighter);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border); border-radius: 999px;
  padding: 6px 14px;
}
.toolbar-search input {
  border: 0; background: none; outline: none;
  font-family: var(--f-body); font-size: .84rem; color: var(--color-text);
  width: 170px;
}

/* ── Die Wand ─────────────────────────────────────────────── */
.wall {
  flex: 1;
  padding: 26px clamp(12px, 3vw, 44px) 40px;
  background:
    radial-gradient(1100px 480px at 50% 8%, rgba(255,255,255,.55), transparent 68%),
    var(--noise),
    linear-gradient(168deg, var(--wall) 0%, var(--wall-shade) 100%);
}
html.dark .wall {
  background:
    radial-gradient(1100px 520px at 50% 6%, rgba(120,170,220,.13), transparent 66%),
    var(--noise),
    linear-gradient(168deg, var(--wall) 0%, var(--wall-shade) 100%);
}
.board-wrap { max-width: 1240px; margin: 0 auto; }

/* ── Board-Registerkarten ─────────────────────────────────── */
.board-tabs {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 0 34px; position: relative; z-index: 0;
}
.board-tab {
  --tab-akzent: var(--blue);
  font-family: var(--f-head); font-weight: 700; font-size: .82rem;
  color: #5d6673;
  background: linear-gradient(180deg, #f2f3f4, #d9dcdf 88%);
  border: 1px solid #c3c7cc; border-bottom: 0;
  border-radius: 9px 9px 0 0;
  padding: 9px 20px 15px;
  cursor: pointer;
  transform: translateY(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 -2px 8px rgba(0,0,0,.05);
  transition: transform var(--transition), color var(--transition), background var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.board-tab::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--tab-akzent); opacity: .55;
  transition: opacity var(--transition);
}
.board-tab:hover { transform: translateY(3px); color: #333c47; }
.board-tab.active {
  color: var(--tab-akzent);
  background: linear-gradient(180deg, #fdfdfd, #eff0f1 90%);
  transform: translateY(1px);
}
.board-tab.active::before { opacity: 1; }
.board-tab .tab-count {
  font-size: .68rem; font-weight: 600; color: #8a93a0;
  background: rgba(0,0,0,.06); border-radius: 999px; padding: 1px 7px;
}

/* ── Whiteboard: Alu-Rahmen ───────────────────────────────── */
.board-frame {
  position: relative; z-index: 1;
  border-radius: 7px;
  padding: 15px;
  background:
    repeating-linear-gradient(92deg, rgba(255,255,255,.13) 0 1px, rgba(0,0,0,.03) 1px 3px),
    linear-gradient(180deg, #e3e6e9 0%, #c9cdd2 26%, #b7bbc0 50%, #ccd0d4 74%, #eceef0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 2px 4px rgba(0,0,0,.12),
    0 14px 28px -10px rgba(0,0,0,.28),
    0 36px 70px -24px rgba(0,0,0,.35);
}
html.dark .board-frame {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    0 2px 4px rgba(0,0,0,.4),
    0 16px 32px -10px rgba(0,0,0,.55),
    0 44px 80px -24px rgba(0,0,0,.6);
}
/* Eckkappen (dunkelblaue Kunststoff-Kappen wie am echten Brett) */
.board-cap {
  position: absolute; width: 26px; height: 26px; z-index: 3;
  background:
    radial-gradient(circle at 34% 30%, rgba(255,255,255,.5), rgba(255,255,255,0) 45%),
    radial-gradient(circle at 50% 55%, #3d5878 0%, #2b415d 60%, #1d2e44 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 -1px 2px rgba(0,0,0,.3);
}
.board-cap--tl { top: -5px; left: -5px;  border-radius: 8px 3px 3px 3px; }
.board-cap--tr { top: -5px; right: -5px; border-radius: 3px 8px 3px 3px; }
.board-cap--bl { bottom: -5px; left: -5px;  border-radius: 3px 3px 3px 8px; }
.board-cap--br { bottom: -5px; right: -5px; border-radius: 3px 3px 8px 3px; }

/* ── Tafelfläche ──────────────────────────────────────────── */
.board-surface {
  position: relative;
  min-height: 44vh;
  border-radius: 3px;
  background:
    radial-gradient(1000px 420px at 26% 12%, rgba(255,255,255,.85), transparent 62%),
    radial-gradient(700px 320px at 78% 80%, rgba(219,222,216,.5), transparent 65%),
    radial-gradient(220px 130px at 62% 34%, rgba(206,210,203,.35), transparent 70%),
    var(--noise),
    linear-gradient(158deg, #f8f9f7 0%, var(--tafel) 55%, #eceeea 100%);
  box-shadow:
    inset 0 3px 9px rgba(0,0,0,.16),
    inset 0 -2px 5px rgba(0,0,0,.07),
    inset 2px 0 5px rgba(0,0,0,.05),
    inset -2px 0 5px rgba(0,0,0,.05);
}

/* ── Stiftablage (dekorativ) ──────────────────────────────── */
.board-tray {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  width: min(310px, 42%); height: 15px; z-index: 2;
  border-radius: 3px 3px 6px 6px;
  background: linear-gradient(180deg, #d6d9dd 0%, #b4b8bd 55%, #9ea2a8 100%);
  box-shadow: 0 5px 9px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.65);
}
.tray-marker {
  position: absolute; top: -7px; left: 22%;
  width: 86px; height: 9px; border-radius: 5px;
  background: linear-gradient(180deg, #3a4048, #23272d);
  box-shadow: 0 2px 3px rgba(0,0,0,.3);
}
.tray-marker::after {
  content: ''; position: absolute; right: -13px; top: 0;
  width: 17px; height: 9px; border-radius: 3px 5px 5px 3px;
  background: linear-gradient(180deg, #2196dd, #0e6aa8);
}
.tray-eraser {
  position: absolute; top: -9px; right: 20%;
  width: 44px; height: 11px; border-radius: 2px;
  background: linear-gradient(180deg, #f3f4f5, #cfd3d7 70%, #9aa0a6);
  box-shadow: 0 2px 3px rgba(0,0,0,.28);
}

/* ── Zettel-Raster ────────────────────────────────────────── */
.board-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));  /* ~60% (AL 2026-07-07) */
  gap: 26px 20px;
  padding: 34px 30px 46px;
}

/* ── Der Zettel ───────────────────────────────────────────── */
.note {
  --rot: 0deg; --dx: 0px; --dy: 0px; --mx: 50%;
  position: relative;
  transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
  transition: transform .28s cubic-bezier(.34, 1.4, .5, 1);
  will-change: transform;
  cursor: pointer;
  outline: none;
}
/* Hover-Schatten als Pseudo-Element (Opacity-Crossfade, nie box-shadow animieren) */
.note::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
  box-shadow: 0 14px 24px rgba(0,0,0,.2), 0 24px 48px rgba(0,0,0,.16);
  opacity: 0; transition: opacity .28s ease;
}
.note:hover, .note:focus-visible {
  transform: translate(var(--dx), calc(var(--dy) - 7px)) rotate(0deg) scale(1.028);
  z-index: 6;
}
.note:hover::before, .note:focus-visible::before { opacity: 1; }
.note:focus-visible .note-paper { outline: 3px solid var(--blue); outline-offset: 2px; }

.note-paper {
  position: relative;
  background:
    var(--noise),
    linear-gradient(176deg, var(--papier) 0%, #fbfaf6 68%, #f2f0e9 100%);
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgba(0,0,0,.06),
    0 2px 2px rgba(0,0,0,.06),
    0 4px 4px rgba(0,0,0,.06),
    0 7px 9px rgba(0,0,0,.07),
    0 12px 20px rgba(0,0,0,.09);
  overflow: hidden;
}
/* Eselsohr unten rechts */
.note-paper::after {
  content: ''; position: absolute; right: 0; bottom: 0;
  width: 17px; height: 17px;
  background: linear-gradient(315deg, transparent 47%, rgba(0,0,0,.055) 50%, rgba(0,0,0,.015) 62%, transparent 72%);
}
.note-thumb {
  display: block; width: 100%;
  aspect-ratio: 210 / 260;
  object-fit: cover; object-position: top;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.05);
  filter: saturate(.97);
}
.note-thumb--placeholder {
  display: grid; place-items: center;
  font-size: 2.2rem; color: #c5cad1;
}
.note-foot { padding: 6px 8px 8px; background: rgba(255,255,255,.55); }
.note-title {
  font-family: var(--f-head); font-weight: 700; font-size: .68rem; line-height: 1.24;
  color: #23303f;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note-meta {
  display: flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: .58rem; color: #7c8694; flex-wrap: wrap;
}
.note-chip {
  font-weight: 700; letter-spacing: .02em;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(0,128,201,.1); color: #026aa4;
}
.note-chip--Rundschreiben { background: rgba(220,80,15,.1); color: #b8420c; }
.note-chip--Hinweis { background: rgba(107,114,128,.12); color: #4d5560; }

/* Magnet auf dem Zettel — kleiner passend zum ~60%-Zettel */
.note .magnet { position: absolute; top: -9px; left: var(--mx); transform: translateX(-50%); z-index: 4; width: 21px; height: 21px; }

/* ── Magnete (Dom-Magnete mit Specular-Highlight) ─────────── */
.magnet {
  display: inline-block; width: 31px; height: 31px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 27%, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 50% 52%, var(--m) 0%, var(--m) 52%, var(--m-d) 100%);
  box-shadow:
    0 3px 5px rgba(0,0,0,.32),
    0 1px 2px rgba(0,0,0,.28),
    inset 0 -2px 4px rgba(0,0,0,.3),
    inset 0 1px 2px rgba(255,255,255,.4);
}
.magnet--blue   { --m: var(--mag-blue);   --m-d: var(--mag-blue-d); }
.magnet--red    { --m: var(--mag-red);    --m-d: var(--mag-red-d); }
.magnet--yellow { --m: var(--mag-yellow); --m-d: var(--mag-yellow-d); }
.magnet--green  { --m: var(--mag-green);  --m-d: var(--mag-green-d); }

/* Wichtig (roter Magnet): Zettel dezent hervorheben */
.note--wichtig .note-paper { box-shadow: 0 0 0 2px rgba(210,59,42,.35), 0 1px 1px rgba(0,0,0,.06), 0 2px 2px rgba(0,0,0,.06), 0 4px 4px rgba(0,0,0,.06), 0 7px 9px rgba(0,0,0,.07), 0 12px 20px rgba(0,0,0,.09); }

/* ── Sticker & Stempel auf dem Zettel ─────────────────────── */
.note-badge-neu {
  position: absolute; top: -9px; right: -11px; z-index: 5;
  font-family: var(--f-hand); font-weight: 700; font-size: 1.02rem; line-height: 1;
  color: #fff; background: var(--orange);
  padding: 5px 11px 6px; border-radius: 999px;
  transform: rotate(7deg);
  box-shadow: 0 3px 7px rgba(220,80,15,.4);
}
.note-stamp {
  position: absolute; left: 50%; top: 40%; z-index: 5;
  transform: translate(-50%, -50%) rotate(-9deg);
  pointer-events: none;
}
.stamp {
  font-family: var(--f-head); font-weight: 800; font-size: .72rem;
  letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
  color: #2e7d32; border: 3px double #2e7d32; border-radius: 7px;
  padding: 5px 11px;
  background: rgba(255,255,255,.16);
  opacity: .88;
  mix-blend-mode: multiply;
  -webkit-mask-image: var(--noise), linear-gradient(#000, #000);
          mask-image: var(--noise), linear-gradient(#000, #000);
}
.stamp--grey { color: #6b7280; border-color: #6b7280; }
.stamp--red  { color: #b91c1c; border-color: #b91c1c; }
/* Stempel-„Knall“ beim Bestätigen */
@keyframes stamp-hit {
  0%   { transform: translate(-50%, -50%) rotate(-9deg) scale(2.1); opacity: 0; }
  55%  { transform: translate(-50%, -50%) rotate(-9deg) scale(.94); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-9deg) scale(1); opacity: 1; }
}
.note-stamp--hit { animation: stamp-hit .42s cubic-bezier(.2, 1.2, .4, 1) both; }

/* Kenntnisnahme offen: Fähnchen unten */
.note-flag {
  position: absolute; bottom: -8px; left: 12px; z-index: 5;
  font-size: .64rem; font-weight: 700; color: #fff;
  background: #b91c1c; border-radius: 4px; padding: 3px 9px;
  transform: rotate(-2deg);
  box-shadow: 0 2px 6px rgba(185,28,28,.4);
}
.note-flag--frist { background: #92400e; }

/* Entwurf */
.note--entwurf .note-paper { filter: grayscale(.35); }
.note--entwurf .note-thumb { opacity: .8; }

/* ── Skeleton & Leerzustand ───────────────────────────────── */
.board-loading {
  display: flex; gap: 34px; padding: 46px 42px;
}
.skel-note {
  width: 216px; aspect-ratio: 210 / 300;
  border-radius: 2px;
  transform: rotate(var(--rot));
  background: linear-gradient(100deg, #ececea 40%, #f7f7f5 50%, #ececea 60%);
  background-size: 220% 100%;
  animation: skel 1.3s ease-in-out infinite;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
@keyframes skel { to { background-position: -120% 0; } }
.board-empty { display: grid; place-items: center; padding: 70px 20px; }
.empty-note {
  position: relative; text-align: center;
  padding: 42px 46px 34px;
  background: var(--noise), linear-gradient(176deg, #fffef9, #f6f3e9);
  border-radius: 2px;
  transform: rotate(1.6deg);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.empty-note .magnet { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); }
.empty-hand { font-family: var(--f-hand); font-weight: 700; font-size: 1.65rem; color: #3c4654; }
.empty-sub { font-size: .78rem; color: #8a93a0; margin-top: 6px; }

/* ── Fußzeile ─────────────────────────────────────────────── */
.foot {
  display: flex; gap: 8px; justify-content: center;
  padding: 12px; font-size: .72rem; color: var(--color-text-lighter);
  background: var(--color-card); border-top: 1px solid var(--color-border);
}

/* ── Dialoge ──────────────────────────────────────────────── */
.dlg {
  border: 0; border-radius: 14px; padding: 0;
  background: var(--color-card); color: var(--color-text);
  box-shadow: var(--shadow-modal);
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
}
.dlg::backdrop { background: rgba(10, 18, 30, .55); backdrop-filter: blur(3px); }
.dlg--detail { width: min(1120px, calc(100vw - 32px)); }
.dlg--status { width: min(900px, calc(100vw - 32px)); }
.dlg-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--color-border);
}
.dlg-head h2 { font-family: var(--f-head); font-weight: 800; font-size: 1.12rem; color: var(--blue); }
.dlg-head-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dlg-close {
  flex: 0 0 auto;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 1rem; color: var(--color-text-muted);
  background: var(--color-bg-light); border: 0; border-radius: 9px; cursor: pointer;
  transition: all var(--transition);
}
.dlg-close:hover { background: var(--color-danger); color: #fff; }
.dlg-body { padding: 18px 22px 22px; overflow-y: auto; max-height: calc(100vh - 170px); }
.dlg-body--split { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

.det-doc { display: flex; flex-direction: column; gap: 10px; min-height: 480px; }
.det-doc iframe {
  flex: 1; width: 100%; min-height: 460px;
  border: 1px solid var(--color-border); border-radius: 8px; background: #525659;
}
.det-open-tab { align-self: flex-start; }
.det-desc { font-size: .88rem; line-height: 1.55; color: var(--color-text-muted); margin-bottom: 14px; white-space: pre-line; }
.det-facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: .8rem; margin-bottom: 16px; }
.det-facts dt { font-weight: 700; color: var(--color-text-lighter); }
.det-facts dd { color: var(--color-text); }
.det-kenntnis {
  border: 1px dashed var(--blue); border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
  background: rgba(0,128,201,.05);
}
.det-kenntnis-info { font-size: .8rem; margin-bottom: 10px; }
.det-kenntnis-hint { font-size: .72rem; color: var(--color-text-lighter); margin-top: 8px; }
.det-stamp-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 14px 18px; margin-bottom: 14px; }
.det-stamp-done .stamp { font-size: .84rem; transform: rotate(-5deg); }
.stamp-date { font-size: .72rem; color: var(--color-text-lighter); }
.det-lead, .det-admin {
  border-top: 1px solid var(--color-border);
  padding-top: 14px; margin-top: 4px;
}
.det-lead h3, .det-admin h3 { font-family: var(--f-head); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-lighter); margin-bottom: 8px; }
.det-lead p { font-size: .8rem; margin-bottom: 10px; }
.det-admin-btns { display: flex; flex-direction: column; gap: 8px; }
.det-quote { margin-top: 12px; font-size: .8rem; }

/* Quote-Balken */
.quote-bar { height: 9px; border-radius: 5px; background: var(--color-bg-light); overflow: hidden; margin: 5px 0; }
.quote-bar > span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue), #35b46a); transition: width .5s ease; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-head); font-weight: 700; font-size: .84rem;
  border: 0; border-radius: var(--radius); padding: 10px 18px; cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.btn--primary { color: #fff; background: var(--blue); box-shadow: 0 3px 10px rgba(0,128,201,.3); }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-dark); transform: translateY(-1px); }
.btn--primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn--secondary { color: #fff; background: #35b46a; }
.btn--secondary:hover { background: #2b9457; }
.btn--ghost { color: var(--color-text-muted); background: var(--color-bg-light); border: 1px solid var(--color-border); }
.btn--ghost:hover { color: var(--blue); border-color: var(--blue); }

/* ── Anpinnen-Formular ────────────────────────────────────── */
.pin-source-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.pin-src-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-head); font-weight: 700; font-size: .8rem;
  color: var(--color-text-muted); background: var(--color-bg-light);
  border: 1px solid var(--color-border); border-radius: 9px;
  padding: 9px 16px; cursor: pointer; transition: all var(--transition);
}
.pin-src-tab.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed var(--color-border); border-radius: 12px;
  padding: 26px; cursor: pointer; text-align: center;
  font-size: .84rem; color: var(--color-text-muted);
  transition: all var(--transition);
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(0,128,201,.05); }
.dropzone-icon { font-size: 1.7rem; }
.pin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field label, .field .label, .pin-src label { font-size: .76rem; font-weight: 700; color: var(--color-text-muted); }
.field input[type="text"], .field input[type="date"], .field select, .field textarea, .pin-src input[type="text"] {
  font-family: var(--f-body); font-size: .86rem; color: var(--color-text);
  background: var(--color-bg-light);
  border: 1px solid var(--color-input-border); border-radius: 9px;
  padding: 9px 12px; outline: none; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus, .pin-src input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }
.field-hint { font-size: .72rem; color: var(--color-text-lighter); margin-top: 4px; }
.muted { font-weight: 400; color: var(--color-text-lighter); }
.check { display: flex; align-items: center; gap: 8px; font-size: .84rem; cursor: pointer; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; }
.check--strong span { font-weight: 700; }
.check--sm { display: inline-flex; font-size: .78rem; }
.pin-empf { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pin-empf legend { font-size: .76rem; font-weight: 700; color: var(--color-text-muted); padding: 0 6px; }
.pin-bereiche { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-left: 24px; }
.magnet-picker { display: flex; align-items: center; gap: 10px; }
.magnet-opt { border: 3px solid transparent; cursor: pointer; padding: 0; transition: transform var(--transition); }
.magnet-opt:hover { transform: scale(1.12); }
.magnet-opt.active { border-color: var(--color-text); border-radius: 50%; }
.magnet-picker-hint { font-size: .72rem; color: var(--color-text-lighter); }
.dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.pin-flow-hint { font-size: .74rem; color: var(--color-text-lighter); max-width: 330px; }
.dlg-foot-btns { display: flex; gap: 10px; margin-left: auto; }

/* ── Meine Mitteilungen / Status-Listen ───────────────────── */
.meine-sec-h { font-family: var(--f-head); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-lighter); margin: 14px 0 8px; }
.meine-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer;
  transition: all var(--transition);
}
.meine-item:hover { border-color: var(--blue); background: var(--color-hover-row); }
.meine-item--offen { border-left: 4px solid var(--orange); }
.meine-item--gelesen { border-left: 4px solid #35b46a; opacity: .75; }
.meine-item-t { font-weight: 700; font-size: .86rem; flex: 1; }
.meine-item-m { font-size: .72rem; color: var(--color-text-lighter); }
.status-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.status-tbl th { text-align: left; font-family: var(--f-head); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-lighter); padding: 8px 10px; border-bottom: 2px solid var(--color-border); }
.status-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--color-border-light); vertical-align: middle; }
.status-offen-list { font-size: .74rem; color: var(--color-text-muted); }

/* ── Toasts ───────────────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  font-size: .84rem; font-weight: 600; color: #fff;
  background: #2c3644; border-radius: 10px; padding: 11px 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  animation: toast-in .28s cubic-bezier(.34,1.3,.5,1) both;
}
.toast--success { background: #2e7d32; }
.toast--error { background: #b91c1c; }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } }

/* ── Responsive: ≤768px = Metapher aus, Liste an ──────────── */
@media (max-width: 768px) {
  .hdr { padding: 8px 12px; }
  .hdr-sub, .hdr-btn-label, .hdr-user { display: none; }
  .hdr-btn { padding: 8px 10px; }
  .toolbar { padding: 8px 12px; }
  .toolbar-search { flex: 1; }
  .toolbar-search input { width: 100%; }
  .wall { padding: 12px 10px 30px; }
  .board-tabs { padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
  .board-frame { padding: 8px; }
  .board-cap, .board-tray { display: none; }
  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 22px 14px; padding: 24px 14px 30px;
  }
  .note { transform: none !important; }
  .note:hover, .note:focus-visible { transform: translateY(-3px) !important; }
  .note .magnet { width: 20px; height: 20px; top: -8px; }
  .note-badge-neu { font-size: .84rem; padding: 3px 8px 4px; }
  .dlg-body--split { grid-template-columns: 1fr; }
  .det-doc { min-height: 0; }
  /* v2.1.1: tokenisierte Direkt-URL rendert PDF auch auf iOS/Android → Vorschau anzeigen */
  .det-doc iframe { display: block; width: 100%; height: 60vh; min-height: 300px; }
  .det-open-tab { align-self: stretch; text-align: center; }
  .pin-grid { grid-template-columns: 1fr; }
}

/* ── Reduced Motion: Bewegung raus, Zustände bleiben ──────── */
@media (prefers-reduced-motion: reduce) {
  .note, .note::before, .login-btn, .btn, .board-tab, .magnet-opt { transition: none; }
  .note:hover, .note:focus-visible { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
  .note-stamp--hit { animation: none; }
  .skel-note { animation: none; }
  .toast { animation: none; }
}

/* ── Druck: schlichte Liste ───────────────────────────────── */
@media print {
  .hdr, .toolbar, .board-tabs, .board-tray, .foot { display: none; }
  .wall, .board-frame, .board-surface { background: #fff; box-shadow: none; padding: 0; }
  .note { transform: none; }
}

/* ============================================================
   v2.1 — Dual-Login, Personalnummer, Changelog, Protokoll,
   Schneider-Logo, inaktive Reiter, Cross-Platform (Win/Mac/iOS/Android)
   ============================================================ */

/* Login-Karte (Papier-Look wie .login-note) + Marke */
.login-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 40px 32px 28px;
  text-align: center;
  background-image: var(--noise), linear-gradient(176deg, #fff 0%, #fbfaf6 70%, #f3f1ea 100%);
  border-radius: 3px;
  transform: rotate(-1deg);
  box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 4px 4px rgba(0,0,0,.06),
              0 10px 14px rgba(0,0,0,.08), 0 20px 38px rgba(0,0,0,.17);
  color: #1E293B;
}
.login-brand { display: block; max-width: 210px; height: auto; margin: 4px auto 14px; }
.login-btn--m365 {
  width: 100%; justify-content: center;
  background: #fff; color: #2b3440; border: 1.5px solid #d5dbe3;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.login-btn--m365:hover { box-shadow: 0 5px 16px rgba(0,0,0,.13); border-color: #b9c2cd; }

/* Personalnummer-Formular (Primärweg, mobil-first, große Touch-Ziele) */
.persnr-form { text-align: left; margin: 4px 0 6px; }
.persnr-label { display: block; font-family: var(--f-head); font-weight: 700; font-size: .82rem; color: #0B3556; margin-bottom: 8px; }
.persnr-row { display: flex; gap: 8px; }
#persnr-input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.15rem; letter-spacing: .18em; text-align: center;
  padding: 13px 12px; border: 1.5px solid #cdd5df; border-radius: var(--radius);
  background: #fff; color: #16202e;
}
#persnr-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,128,201,.16); }
.persnr-btn {
  flex: 0 0 auto; font-family: var(--f-head); font-weight: 700; font-size: .95rem; color: #fff;
  background: var(--orange); border: 0; border-radius: var(--radius); padding: 0 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(220,80,15,.32); transition: transform var(--transition), box-shadow var(--transition);
}
.persnr-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(220,80,15,.4); }
.persnr-btn:disabled { opacity: .6; cursor: default; transform: none; }
.persnr-error { margin-top: 9px; font-size: .8rem; color: #c0311f; font-weight: 600; }
.persnr-hint { margin-top: 8px; font-size: .72rem; color: #8a93a0; }
.login-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: #a2abb6; font-size: .72rem; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: #e0e4ea; }

/* User-Chip: Persid-Kennzeichnung + klickbar (Abmelden) */
.hdr-user { cursor: pointer; }
.hdr-user--persid::before { content: "🔒 "; font-size: .8em; }

/* Inaktive Reiter (z. B. KI) — nur für Admins sichtbar */
.board-tab--inaktiv { opacity: .62; }
.tab-inaktiv { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #94a0ae; background: rgba(148,160,174,.16); padding: 1px 5px; border-radius: 5px; margin-left: 2px; }

/* Doktyp-Chip-Farben (2 Typen) */
.note-chip--Aushang { background: rgba(0,128,201,.13); color: #0768a3; }
.note-chip--Mitteilung { background: rgba(220,80,15,.14); color: #b0410d; }

/* Footer-Version als Button + „neu"-Puls */
.foot-version { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline dotted transparent; }
.foot-version:hover { text-decoration: underline dotted currentColor; }
.foot-version--neu::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px;
  border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(220,80,15,.6); animation: fv-puls 1.8s infinite; vertical-align: middle; }
@keyframes fv-puls { 0% { box-shadow: 0 0 0 0 rgba(220,80,15,.5); } 70% { box-shadow: 0 0 0 6px rgba(220,80,15,0); } 100% { box-shadow: 0 0 0 0 rgba(220,80,15,0); } }

/* Changelog-Dialog */
.dlg--versions .dlg-body { max-width: 560px; }
.version-entry { padding: 12px 0; border-bottom: 1px solid var(--color-border, #e6e9ee); }
.version-entry:last-child { border-bottom: 0; }
.version-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-num { font-family: var(--f-head); font-weight: 800; color: var(--blue); font-size: 1.02rem; }
.version-date { font-size: .78rem; color: #8a93a0; }
.version-akt { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #237a49; background: rgba(53,180,106,.16); padding: 1px 7px; border-radius: 6px; }
.version-title { font-weight: 700; margin: 4px 0 3px; font-size: .9rem; }
.dlg--versions ul { margin: 4px 0 0 18px; font-size: .84rem; line-height: 1.55; }

/* Protokoll: Aktions-Badges */
.log-act { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.log-act--pin { background: rgba(0,128,201,.14); color: #0768a3; }
.log-act--off { background: rgba(148,160,174,.18); color: #5a6472; }
.log-act--upd { background: rgba(220,80,15,.14); color: #b0410d; }

/* ── Cross-Platform: Windows · macOS · iOS · Android ──────────── */
/* Safe-Area (iPhone Notch/Home-Indicator) */
@supports (padding: max(0px)) {
  .hdr  { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .foot { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
}
/* Kein blaues Tap-Highlight (iOS/Android), sauberes Touch-Verhalten */
button, .note, .board-tab, .chip, a, .meine-item { -webkit-tap-highlight-color: transparent; }
input, textarea, select { -webkit-appearance: none; appearance: none; }

/* Touch-first Feinschliff für Smartphones (Primärzugang via QR) */
@media (max-width: 768px) {
  /* User-Chip als kompaktes Kürzel sichtbar lassen (Abmelden erreichbar) */
  .hdr-user { display: inline-flex !important; max-width: 38vw; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: .74rem; }
  .persnr-btn { padding: 0 16px; }
  #persnr-input { font-size: 1.05rem; padding: 14px 10px; }  /* ≥16px-nah, iOS-Zoom-arm */
  /* Größere Touch-Ziele */
  .hdr-btn, .hdr-icon { min-height: 40px; }
  .note { min-height: 44px; }
  .board-tab { padding-top: 10px; padding-bottom: 10px; }
  .dlg { width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; }
  .dlg-body--split { grid-template-columns: 1fr !important; }
  .det-doc iframe { height: 60vh; min-height: 300px; }
}
/* iOS: 16px-Inputs verhindern Auto-Zoom im Detail/Anpinnen */
@media (max-width: 768px) and (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}

/* ============================================================
   v2.2 — Board-Rubriken (Spalten-Split), Verschieben/Löschen,
   Verlauf am Dok, Archiv (AL 2026-07-07)
   ============================================================ */

/* Mehrspaltiges Board (QM 2-teilig, Compliance 3-teilig): Spalten durch dezente
   Trennlinie strukturiert, Zettel je Rubrik zentriert (wirkt auch bei wenig Inhalt
   aufgeräumt statt oben-links geklumpt mit großem Leerraum). */
.board-grid--rubriken { display: flex; gap: 0; align-items: stretch; }
.rubrik-col { flex: 1 1 0; min-width: 0; list-style: none; padding: 0 26px; }
.rubrik-col:first-child { padding-left: 8px; }
.rubrik-col:last-child { padding-right: 8px; }
.rubrik-col + .rubrik-col { border-left: 1px dashed rgba(60,80,110,.20); }
html.dark .rubrik-col + .rubrik-col { border-left-color: rgba(180,200,225,.16); }
.rubrik-head {
  font-family: var(--f-head); font-weight: 800; font-size: .92rem; color: #0B3556;
  border-bottom: 2px solid rgba(0,128,201,.28); padding-bottom: 7px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 7px;
}
html.dark .rubrik-head { color: #cfe4f3; }
.rubrik-count { font-size: .68rem; font-weight: 700; color: #7c8694; background: rgba(148,160,174,.18); padding: 1px 7px; border-radius: 8px; }
.rubrik-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, 146px); justify-content: start; gap: 26px 18px; }
.rubrik-empty {
  grid-column: 1 / -1; color: #aab3be; font-size: .82rem; font-style: italic; text-align: center;
  padding: 30px 10px; list-style: none; border: 1px dashed rgba(60,80,110,.18); border-radius: 10px;
}
html.dark .rubrik-empty { border-color: rgba(180,200,225,.14); }

/* Detail: Verschieben */
.det-move { margin: 12px 0 6px; }
.det-move > label { display: block; font-size: .76rem; font-weight: 700; color: #43506a; margin-bottom: 6px; }
.det-move-row { display: flex; gap: 6px; flex-wrap: wrap; }
.det-move-row select {
  flex: 1 1 auto; min-width: 88px; padding: 7px 8px; font: inherit; font-size: .82rem;
  border: 1px solid #cdd5df; border-radius: 8px; background: #fff; color: #16202e;
}

/* Detail: Verlauf */
.det-verlauf { margin-top: 16px; }
.det-verlauf h3, .det-admin h3 { font-family: var(--f-head); font-weight: 700; font-size: .82rem; color: #0B3556; margin-bottom: 8px; }
html.dark .det-verlauf h3, html.dark .det-admin h3 { color: #cfe4f3; }
.verlauf-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.verlauf-list li { display: flex; align-items: center; gap: 9px; font-size: .74rem; color: #5a6472; }
.verlauf-zeit { color: #8a93a0; min-width: 116px; }
.verlauf-wer { font-weight: 700; color: #43506a; margin-left: auto; }

/* Archiv-Dialog */
.archiv-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--color-border, #e6e9ee); flex-wrap: wrap; }
.archiv-item:last-child { border-bottom: 0; }
.archiv-item-t { flex: 1 1 230px; min-width: 0; }
.archiv-item-t strong { display: block; font-size: .9rem; }
.archiv-item-btns { display: flex; gap: 6px; }

/* Gefahr-Button (Löschen) */
.btn--danger { color: #fff; background: #c0311f; border: 1px solid #c0311f; }
.btn--danger:hover { background: #a52817; border-color: #a52817; }

/* Mobile: Rubriken-Spalten stapeln */
@media (max-width: 768px) {
  .board-grid--rubriken { flex-direction: column; gap: 26px; }
  .rubrik-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .verlauf-zeit { min-width: 92px; }
}

/* ── v2.3: Link-/Dashboard-Kachel (quelle=link) ─────────────────────── */
.note--link .note-paper { box-shadow: 0 2px 10px rgba(0, 128, 201, .18); }
.note--link .note-paper::after {
  content: "↗";
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #0080C9;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.note--link .note-chip { background: #0080C9; color: #fff; }
