/*
 * Einheitliche Dimmung (apl3-Parität):
 * - Vollbild-Overlay (9997): Sidebars
 * - Canvas (9998): inset box-shadow — Platten bleiben hell
 * - Topbar: .focus-ui-dim ::after
 */

:root {
  --focus-dim-opacity: 0.6;
}

.placement-focus-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, var(--focus-dim-opacity));
  z-index: 9997;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.is-focus-mode .left-sidebar {
  pointer-events: none;
  opacity: 0.3;
}

/* Rechte Sidebar nur dimmen, wenn nicht im Plate-Setup (dort ::after-Overlay). */
body.is-focus-mode .right-sidebar:not(.plate-setup-partial-dim) {
  pointer-events: none;
  opacity: 0.3;
}

body.is-focus-mode .right-sidebar.plate-setup-partial-dim {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Maß-Schritt: nur Maße-Sektion hervorheben, Rest bleibt unter Sidebar-Dimmung */
body.is-plate-setup-mode .sidebar-section.plate-setup-measurement-section-highlight {
  position: relative;
  z-index: 10010;
  isolation: isolate;
}

.topbar.focus-ui-dim {
  pointer-events: none;
}

.topbar.focus-ui-dim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--focus-dim-opacity));
  pointer-events: none;
  z-index: 1;
}

/* Placement-/Setup-Hinweis (apl3 placement-mode-hint) */
.placement-mode-hint {
  position: fixed;
  top: 100px;
  left: 50%;
  box-sizing: border-box;
  background: linear-gradient(155deg, #fffdfb 0%, #fff2eb 48%, #ffe4dc 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #3d1810;
  padding: 14px 26px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  z-index: 10000;
  border: none;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  display: block;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s step-end;
  transform: translateX(-50%) translateY(-8px);
  isolation: isolate;
  overflow: visible;
}

.placement-mode-hint.placement-mode-hint--visible::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: -4px;
  bottom: -4px;
  border-radius: 17px;
  pointer-events: none;
  z-index: 0;
  border: 3px solid rgba(229, 50, 45, 0.42);
  box-shadow: 0 0 10px rgba(229, 50, 45, 0.18);
  opacity: 1;
}

.placement-mode-hint.placement-mode-hint--visible.placement-mode-hint--attention::after {
  animation: placement-hint-ring-breathe 1.85s ease-in-out infinite;
}

.placement-mode-hint.placement-mode-hint--visible {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear;
}

.placement-mode-hint-text {
  position: relative;
  z-index: 1;
  display: block;
}

@keyframes placement-hint-ring-breathe {
  0%,
  100% {
    border-color: rgba(140, 32, 28, 0.82);
    box-shadow:
      0 0 5px rgba(229, 50, 45, 0.1),
      0 0 0 1px rgba(229, 50, 45, 0.15);
    opacity: 0.84;
  }
  50% {
    border-color: #e5322d;
    box-shadow:
      0 0 14px rgba(229, 50, 45, 0.35),
      0 0 0 2px rgba(229, 50, 45, 0.28);
    opacity: 1;
  }
}

.focus-mode-hint {
  position: fixed;
  left: 50%;
  top: calc(var(--topbar-height, 64px) + 1rem);
  transform: translateX(-50%);
  z-index: 10000;
  max-width: min(92%, 520px);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.chamfer-corner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.chamfer-corner-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(229, 50, 45, 0.1);
  color: var(--color-accent, #e5322d);
  font-size: 0.875rem;
  font-weight: 600;
}
