/* ==========================================================================
   WERBELEITFADEN INTERAKTIV - DESIGN SYSTEM & RESPONSIVE STYLES
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --border-subtle: rgba(226, 232, 240, 0.85);
  --border-strong: rgba(203, 213, 225, 1);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Theme Palette from Infographic */
  --c-idee: #e91e63;
  --c-idee-glow: rgba(233, 30, 99, 0.35);
  --c-cd: #334155;
  --c-cd-glow: rgba(51, 65, 85, 0.3);
  --c-analog: #f97316;
  --c-analog-glow: rgba(249, 115, 22, 0.4);
  --c-digital: #0284c7;
  --c-digital-glow: rgba(2, 132, 199, 0.35);
  --c-pillar: #84cc16;
  --c-pillar-glow: rgba(132, 204, 22, 0.35);
  --c-item: #a3e635;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --header-height: 68px;
  --filter-height: 48px;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0b1120;
    --bg-surface: rgba(15, 23, 42, 0.88);
    --bg-surface-elevated: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.82);
    --border-subtle: rgba(51, 65, 85, 0.7);
    --border-strong: rgba(71, 85, 105, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #64748b;
  }
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(2, 132, 199, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(132, 204, 22, 0.04) 0px, transparent 50%);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP HEADER
   ========================================================================== */

.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f97316, #e11d48);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
  transition: transform var(--transition-fast);
  cursor: pointer;
}

.brand-logo-badge:hover {
  transform: rotate(5deg) scale(1.04);
}

.brand-titles h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
  .brand-titles h1 {
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.brand-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.25);
  display: inline-block;
}

.brand-titles p {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Center (Tabs) */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 12px;
}

.view-tabs {
  display: flex;
  background: rgba(148, 163, 184, 0.16);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  max-width: 100%;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Header Right Section */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 200px;
  height: 38px;
  padding: 0 12px 0 34px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  width: 240px;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-light);
  pointer-events: none;
  font-size: 14px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--border-subtle);
  transform: translateY(-1px);
}

.btn-icon.active {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

.btn-planner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-planner:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.badge-count {
  background: rgba(255, 255, 255, 0.28);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
}

/* ==========================================================================
   FILTER CHIPS BAR
   ========================================================================== */

.filter-bar {
  position: absolute;
  top: calc(var(--header-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  z-index: 90;
  box-shadow: var(--shadow-sm);
  max-width: 96vw;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.15);
}

.filter-chip.active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   MAIN CANVAS / VIEWPORT CONTAINER
   ========================================================================== */

.viewport-container {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.viewport-container.dragging {
  cursor: grabbing;
}

/* SVG MINDMAP VIEW */
.mindmap-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
}

.mindmap-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Mindmap Connection Lines */
.edge-line {
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
  transition: stroke 0.25s ease, stroke-width 0.25s ease, opacity 0.25s ease;
}

.edge-line.active {
  stroke: #f97316;
  stroke-width: 3.8;
  stroke-dasharray: 6 6;
  animation: strokeFlow 1s linear infinite;
  filter: drop-shadow(0 0 5px rgba(249, 115, 22, 0.5));
}

@keyframes strokeFlow {
  to {
    stroke-dashoffset: -24;
  }
}

/* Mindmap Nodes - SUBTLE SCALING THAT NEVER SHIFTS OUT OF FRAME */
.node-group {
  cursor: pointer;
  transition: opacity 0.25s ease;
  /* Critical SVG transform rules to keep coordinates anchored */
  transform-box: fill-box;
  transform-origin: center center;
}

.node-halo {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.node-group:hover .node-halo {
  opacity: 0.5;
  transform: scale(1.06); /* Minimal, elegant glow expansion */
}

.node-circle {
  transform-box: fill-box;
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), stroke-width 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.08));
}

/* On hover: subtle scale (3.5%) anchored precisely to circle center */
.node-group:hover .node-circle {
  transform: scale(1.035);
  stroke-width: 3.2px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.16));
}

.node-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
  letter-spacing: -0.01em;
}

.node-group.pulse-highlight .node-circle {
  animation: beaconPulse 1.2s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0px #0284c7); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 16px #0284c7); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0px #0284c7); }
}

.node-group.dimmed {
  opacity: 0.22;
}

/* ==========================================================================
   ORIGINAL PDF VIEW WITH INTERACTIVE HOTSPOTS
   ========================================================================== */

.pdf-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .pdf-viewport {
    background: #0f172a;
  }
}

.pdf-viewport.active {
  display: flex;
}

.pdf-stage {
  position: relative;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  overflow: hidden;
  transform-origin: 0 0;
}

#pdfCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hotspot-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pdf-hotspot {
  position: absolute;
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pdf-hotspot:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: #f97316;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.5);
  transform: translate(-50%, -50%) scale(1.035); /* Subtle scale matching mindmap */
}

.pdf-hotspot.active-pillar {
  border-color: #84cc16;
  background: rgba(132, 204, 22, 0.2);
  box-shadow: 0 0 16px rgba(132, 204, 22, 0.45);
}

.pdf-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(2, 132, 199, 0.2);
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MATRIX / CATALOG VIEW
   ========================================================================== */

.matrix-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow-y: auto;
  padding: 85px 24px 48px;
  background: var(--bg-primary);
  -webkit-overflow-scrolling: touch;
}

.matrix-viewport.active {
  display: block;
}

.matrix-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.matrix-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.matrix-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.card-icon {
  font-size: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -4px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-card-mix {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-card-mix:hover {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.btn-card-mix.in-mix {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

/* ==========================================================================
   INTERACTIVE HUD TOOLTIP (MOUSEOVER)
   ========================================================================== */

.hud-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.15s ease;
  min-width: 240px;
  max-width: 310px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 15px;
  box-shadow: var(--shadow-xl);
}

.hud-tooltip.visible {
  opacity: 1;
}

.hud-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.hud-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.hud-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.hud-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.hud-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.hud-footer {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   ZOOM & PAN ON-SCREEN CONTROLS
   ========================================================================== */

.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 5px;
  z-index: 90;
  box-shadow: var(--shadow-md);
}

.btn-zoom {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-zoom:hover {
  background: var(--border-subtle);
}

/* Floating Mobile Info Trigger */
.btn-mobile-info {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   INFO CARD (LEFT SIDEBAR OVERVIEW)
   ========================================================================== */

.info-card-overlay {
  position: absolute;
  top: calc(var(--header-height) + 16px);
  left: 20px;
  width: 300px;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  transition: all var(--transition-fast);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.info-card-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.info-card-content p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.author-details {
  font-size: 11px;
  color: var(--text-muted);
}

.author-details strong {
  color: var(--text-main);
  display: block;
}

.btn-collapse-info {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
}

.info-card-overlay.collapsed .info-card-content,
.info-card-overlay.collapsed .author-chip {
  display: none;
}

.info-card-overlay.collapsed {
  width: 200px;
  padding: 10px 14px;
}

/* ==========================================================================
   DETAIL DRAWER (GLOSSAR & DEEP-DIVE)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg-surface-elevated);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.22);
  z-index: 310;
  display: flex;
  flex-direction: column;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.detail-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.drawer-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.drawer-close-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.drawer-category-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-node-icon {
  font-size: 28px;
}

.drawer-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.drawer-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.section-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.section-box h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-box p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.praxistipp-box {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.praxistipp-box h3 {
  color: #ea580c;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.praxistipp-box p {
  font-size: 12.8px;
  line-height: 1.55;
  color: var(--text-main);
}

.connections-section h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.connections-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-conn {
  padding: 5px 11px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.chip-conn:hover {
  background: var(--border-subtle);
  border-color: var(--border-strong);
}

.drawer-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-toggle-mix {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: #f97316;
  color: white;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
}

.btn-toggle-mix:hover {
  background: #ea580c;
  transform: translateY(-1px);
}

.btn-toggle-mix.in-mix {
  background: #10b981;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.nav-node-btns {
  display: flex;
  gap: 6px;
}

.btn-nav-node {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.btn-nav-node:hover {
  background: var(--border-subtle);
}

/* ==========================================================================
   MARKETING-MIX PLANNER DRAWER
   ========================================================================== */

.planner-drawer {
  position: fixed;
  top: 0;
  right: -560px;
  width: 520px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg-surface-elevated);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.22);
  z-index: 310;
  display: flex;
  flex-direction: column;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.planner-drawer.open {
  right: 0;
}

.mix-balance-bar {
  display: flex;
  height: 9px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 10px 0 6px;
  background: #e2e8f0;
}

.balance-analog {
  background: #f97316;
  transition: width 0.3s ease;
}

.balance-digital {
  background: #0284c7;
  transition: width 0.3s ease;
}

.mix-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.planner-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.planner-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.planner-item-row:hover {
  border-color: var(--border-strong);
}

.planner-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.planner-item-icon {
  font-size: 18px;
}

.planner-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.planner-item-cat {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-remove-mix {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-remove-mix:hover {
  background: rgba(239, 68, 68, 0.1);
}

.planner-empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.planner-empty-state span {
  font-size: 42px;
  display: block;
  margin-bottom: 10px;
}

.planner-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-primary-action {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all var(--transition-fast);
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
}

.planner-secondary-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary-action {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  background: var(--border-subtle);
}

/* ==========================================================================
   PRINT STYLES FOR MARKETING MIX EXPORT
   ========================================================================== */

@media print {
  .app-header,
  .filter-bar,
  .viewport-container,
  .zoom-controls,
  .info-card-overlay,
  .hud-tooltip,
  .drawer-backdrop,
  .detail-drawer,
  .planner-footer {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  .planner-drawer {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    display: block !important;
  }

  .planner-list {
    overflow: visible !important;
  }
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN (MOBILE, TABLET & DESKTOP)
   ========================================================================== */

/* Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .brand-titles p {
    display: none;
  }

  .search-input {
    width: 160px;
  }

  .search-input:focus {
    width: 200px;
  }

  .info-card-overlay {
    width: 260px;
    padding: 14px;
  }
}

/* Tablets (max-width: 860px) */
@media (max-width: 860px) {
  :root {
    --header-height: 60px;
  }

  .app-header {
    padding: 0 14px;
  }

  .tab-btn span:first-child {
    font-size: 14px;
  }

  .tab-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .search-input {
    width: 130px;
  }

  .search-input:focus {
    width: 170px;
  }

  .btn-planner {
    padding: 0 10px;
    font-size: 12px;
  }

  .btn-planner span:nth-child(2) {
    display: none; /* Icon and badge only on small tablets */
  }

  .filter-bar {
    top: calc(var(--header-height) + 8px);
    padding: 4px 8px;
  }

  .info-card-overlay {
    display: none; /* Hide floating card on tablet/mobile; available via info button */
  }

  .btn-mobile-info {
    display: flex;
  }
}

/* Smartphones / Mobile (max-width: 640px) */
@media (max-width: 640px) {
  :root {
    --header-height: 106px; /* Two-tier mobile header */
  }

  .app-header {
    height: var(--header-height);
    padding: 8px 12px;
    flex-wrap: wrap;
    align-content: space-between;
  }

  /* Row 1: Brand & Actions */
  .brand-section {
    flex: 1;
    min-width: 0;
  }

  .brand-logo-badge {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .brand-titles h1 {
    font-size: 15px;
  }

  .brand-badge {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .search-box {
    display: none; /* Handled in matrix or simplified search */
  }

  .btn-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .btn-planner {
    height: 34px;
    padding: 0 9px;
  }

  /* Row 2: View Switcher Tabs full width */
  .header-center {
    width: 100%;
    order: 3;
    padding: 0;
    margin-top: 4px;
  }

  .view-tabs {
    width: 100%;
    display: flex;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 11.5px;
  }

  /* Filter bar directly below 2-tier header */
  .filter-bar {
    top: calc(var(--header-height) + 6px);
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    width: calc(100% - 24px);
    justify-content: flex-start;
  }

  .viewport-container {
    top: calc(var(--header-height) + 48px);
  }

  .matrix-viewport {
    padding: 10px 14px 40px;
    top: calc(var(--header-height) + 48px);
  }

  .matrix-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Full screen drawers on mobile */
  .detail-drawer,
  .planner-drawer {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }

  .drawer-header {
    padding: 16px 18px;
  }

  .drawer-body,
  .planner-list {
    padding: 16px 18px;
  }

  .drawer-footer,
  .planner-footer {
    padding: 14px 18px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .zoom-controls {
    bottom: 14px;
    left: 14px;
    padding: 4px;
    gap: 4px;
  }

  .btn-zoom,
  .btn-mobile-info {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  /* Tooltip: adjust size for smaller screens */
  .hud-tooltip {
    max-width: 250px;
    padding: 10px 12px;
    font-size: 11px;
  }
}
