/**
 * Globaler Note-It-Anker rechts (neben FAB/Overlay-System)
 *
 * Seitlichen Platz reservieren: Fließtext (z. B. Cockpit „Projektbeteiligte“,
 * lange Gewerke-Listen) darf nicht unter den fixierten Tab rutschen.
 */
body:has(#noteit-side-tab) {
  padding-right: max(3.5rem, calc(env(safe-area-inset-right, 0px) + 2.75rem));
  box-sizing: border-box;
}

.noteit-side-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10068;
  pointer-events: none;
}
.noteit-side-tab > * {
  pointer-events: auto;
}
.noteit-side-tab-btn {
  /* Wie Kevin Bottom-Tabs (.bottom-tab-bar); Rand Post-it-Gelb */
  --noteit-tab-bg: rgba(255, 251, 235, 0.96);
  --noteit-tab-text: var(--kevin-muted, #57534e);
  --noteit-postit-rim: #eab308;
  --noteit-postit-rim-deep: #ca8a04;
  background: var(--noteit-tab-bg);
  backdrop-filter: blur(8px);
  border: 2px solid var(--noteit-postit-rim);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--noteit-tab-text);
  position: relative;
  box-shadow:
    -4px 0 14px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(234, 179, 8, 0.15);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
}
.noteit-side-tab-btn:hover {
  transform: translateX(-4px);
  border-color: var(--noteit-postit-rim-deep);
  box-shadow:
    -6px 0 18px rgba(0, 0, 0, 0.16),
    inset 0 0 0 1px rgba(202, 138, 4, 0.25);
}
.noteit-side-tab-btn:focus-visible {
  outline: 2px solid var(--noteit-postit-rim-deep);
  outline-offset: 2px;
}
.noteit-side-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--kevin-warm-deep, #92400e);
}
.noteit-side-tab-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--accent-danger, #d13438);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(255, 48, 87, 0.45);
  transition: transform 0.15s ease;
}
/* display:flex oben überschreibt sonst das native [hidden] → Badge bleibt sichtbar bei 0 */
.noteit-side-tab-badge[hidden] {
  display: none !important;
}
.noteit-side-tab-badge.pulse {
  animation: noteit-tab-pulse 1.4s ease-in-out 1;
}
@keyframes noteit-tab-pulse {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
/* Nautilus: Fläche wie Ribbon (.nautilus-ribbon), gelber Post-it-Rand wie Basis */
body.theme-standard .noteit-side-tab-btn {
  --noteit-tab-bg: #f3f2f1;
  --noteit-tab-text: #323130;
}
body.theme-standard .noteit-side-tab-label {
  color: #b45309;
}
@media (max-width: 720px) {
  body:has(#noteit-side-tab) {
    /* Tab sitzt unten rechts: zusätzlich unten Luft schaffen */
    padding-bottom: max(5rem, calc(env(safe-area-inset-bottom, 0px) + 4.25rem));
  }

  .noteit-side-tab {
    top: auto;
    bottom: 88px;
    transform: none;
  }
  .noteit-side-tab-btn {
    padding: 14px 9px;
  }
  body.has-kevin-app-tabs .noteit-side-tab {
    bottom: 112px;
  }
}
