/* Mand-Meneer — floating summary widget */

.mand-meneer-fab {
  position: fixed;
  top: 6.5rem;
  right: 0.85rem;
  z-index: 2147483000;
  /* Compact: ~1/4 van 240px lineair ≈ 1/16 van het vlak */
  width: 72px;
  max-width: 18vw;
  min-width: 56px;
  padding: 0;
  border: 2px solid #fff;
  background: #fff;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  line-height: 0;
  overflow: hidden;
}

.mand-meneer-fab:hover,
.mand-meneer-fab:focus-visible {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.3);
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

.mand-meneer-fab img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
  vertical-align: middle;
}

.mand-meneer-fab[hidden],
.mand-meneer-panel[hidden],
.mand-meneer-backdrop[hidden] {
  display: none !important;
}

.mand-meneer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.mand-meneer-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 99999;
  width: min(540px, calc(100vw - 2rem));
  max-height: min(80vh, 640px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.mand-meneer-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 55%, #7c3aed 100%);
  color: #fff;
}

.mand-meneer-panel-header img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.mand-meneer-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.mand-meneer-panel-header p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.mand-meneer-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mand-meneer-close:hover,
.mand-meneer-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.mand-meneer-levels {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1rem 0;
  flex-wrap: wrap;
}

.mand-meneer-level {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.mand-meneer-level[aria-pressed="true"] {
  background: #4c1d95;
  border-color: #4c1d95;
  color: #fff;
}

.mand-meneer-body {
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.55;
}

.mand-meneer-body p {
  margin: 0 0 0.75rem;
}

.mand-meneer-body p:last-child {
  margin-bottom: 0;
}

.mand-meneer-mand {
  display: grid;
  place-items: center;
  min-height: 140px;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4c1d95;
  text-align: center;
}

.mand-meneer-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0 1rem 1rem;
}

.mand-meneer-actions button {
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.mand-meneer-btn-primary {
  background: #4c1d95;
  color: #fff;
}

.mand-meneer-btn-primary:hover,
.mand-meneer-btn-primary:focus-visible {
  background: #3b0764;
}

.mand-meneer-btn-ghost {
  background: #f1f5f9;
  color: #334155;
}

.mand-meneer-btn-ghost:hover,
.mand-meneer-btn-ghost:focus-visible {
  background: #e2e8f0;
}

.mand-meneer-loading {
  color: #64748b;
  font-style: italic;
}

.mand-meneer-source {
  margin-top: 0.85rem !important;
  font-size: 0.78rem;
  color: #64748b;
  font-style: italic;
}

@media (max-width: 640px) {
  .mand-meneer-fab {
    top: auto;
    bottom: 5.5rem;
    right: 0.65rem;
    width: 64px;
    max-width: 20vw;
    min-width: 52px;
  }

  .mand-meneer-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 78vh;
    transform: none;
    border-radius: 16px 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mand-meneer-fab {
    transition: none;
  }
}
