/* ===================================================
   Mappa Procedurale — Style
   =================================================== */

/* --- Design tokens from shared design system --- */
:root, [data-theme='light'] {
  --font-display: 'Chillax', 'Arial', sans-serif;
  --font-body: 'Nunito', 'Helvetica Neue', sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-2: #f0f4f8;
  --color-border: #d0d7e0;
  --color-divider: #e2e8f0;
  --color-text: #1a2a3a;
  --color-text-muted: #5a6a7a;
  --color-text-faint: #94a3b8;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-primary-dark: #1e40af;
  --color-success: #16a34a;
  --color-success-light: #dcfce7;
  --color-success-dark: #15803d;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-accent: #0d9488;
  --color-accent-light: #ccfbf1;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Phase colors */
  --phase-engage: #f59e0b;
  --phase-engage-light: #fef3c7;
  --phase-explore: #8b5cf6;
  --phase-explore-light: #ede9fe;
  --phase-explain: #2563eb;
  --phase-explain-light: #dbeafe;
  --phase-elaborate: #0d9488;
  --phase-elaborate-light: #ccfbf1;
  --phase-evaluate: #16a34a;
  --phase-evaluate-light: #dcfce7;

  --detail-bg: var(--color-surface);
  --node-size: 120px;
  --node-size-mobile: 90px;
}

[data-theme='dark'] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-2: #283548;
  --color-border: #334155;
  --color-divider: #1e293b;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-faint: #64748b;
  --color-primary: #60a5fa;
  --color-primary-hover: #3b82f6;
  --color-primary-light: #1e3a5f;
  --color-primary-dark: #93c5fd;
  --color-success: #4ade80;
  --color-success-light: #14532d;
  --color-error: #f87171;
  --color-error-light: #450a0a;
  --color-warning: #fbbf24;
  --color-warning-light: #451a03;
  --color-accent: #2dd4bf;
  --color-accent-light: #134e4a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

  --phase-engage: #fbbf24;
  --phase-engage-light: #451a03;
  --phase-explore: #a78bfa;
  --phase-explore-light: #2e1065;
  --phase-explain: #60a5fa;
  --phase-explain-light: #1e3a5f;
  --phase-elaborate: #2dd4bf;
  --phase-elaborate-light: #134e4a;
  --phase-evaluate: #4ade80;
  --phase-evaluate-light: #14532d;

  --detail-bg: var(--color-surface);
}

/* --- Base reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a, button, [role='button'] {
  transition: color var(--transition-interactive), background var(--transition-interactive);
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
p, li { text-wrap: pretty; max-width: 72ch; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) var(--space-6);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.header-left, .header-right {
  flex: 0 0 auto;
}
.header-center {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  justify-content: center;
}
.header-logo svg {
  color: var(--color-primary);
}
.header-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}
.back-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  transition: background var(--transition-interactive);
}
.theme-toggle:hover {
  background: var(--color-surface-2);
}

/* --- Breadcrumb / Mini-map --- */
.breadcrumb {
  position: sticky;
  top: 53px;
  z-index: 90;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) var(--space-4);
}
.breadcrumb-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.breadcrumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-lg);
  transition: background var(--transition-interactive);
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}
.breadcrumb-item:hover {
  background: var(--color-surface-2);
}
.breadcrumb-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  border: 2px solid var(--color-bg);
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.breadcrumb-item.active .breadcrumb-dot {
  transform: scale(1.3);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.breadcrumb-item.visited .breadcrumb-dot {
  background: var(--color-primary);
  border-color: var(--color-primary-light);
}
.breadcrumb-item.active .breadcrumb-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.breadcrumb-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  transition: color var(--transition-interactive);
  white-space: nowrap;
}
.breadcrumb-item.active .breadcrumb-label,
.breadcrumb-item.visited .breadcrumb-label {
  color: var(--color-text);
}
.breadcrumb-line {
  flex: 1;
  max-width: 48px;
  min-width: 12px;
  height: 2px;
  background: var(--color-border);
  border-radius: 1px;
  transition: background 300ms ease;
}
.breadcrumb-line.active {
  background: var(--color-primary);
}

/* --- Map container --- */
.map-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  /* Fill remaining viewport */
  height: calc(100dvh - 53px - 54px);
  min-height: 400px;
}
.map-scroll {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}
.map-scroll::-webkit-scrollbar { display: none; }

.map-nodes {
  display: flex;
  align-items: center;
  gap: clamp(60px, 8vw, 140px);
  padding: var(--space-12) clamp(var(--space-12), 15vw, 20vw);
  position: relative;
  z-index: 2;
  min-width: max-content;
}

/* --- SVG connector path --- */
.map-path-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.connecting-path-bg {
  stroke: var(--color-border);
  stroke-width: 3;
  stroke-dasharray: 12 8;
  opacity: 0.5;
}
.connecting-path {
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-dasharray: 12 8;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dash-march {
  to { stroke-dashoffset: -40; }
}
.connecting-path-bg {
  animation: dash-march 2s linear infinite;
}

/* --- Map node --- */
.map-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  scroll-snap-align: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.node-circle {
  position: relative;
  width: var(--node-size);
  height: var(--node-size);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition:
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 300ms cubic-bezier(0.16, 1, 0.3, 1),
    background 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.node-circle .node-emoji {
  font-size: 2rem;
  line-height: 1;
}
.node-circle .node-step {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-1);
}

/* Hover */
.map-node:hover .node-circle {
  transform: translateY(-6px) scale(1.05);
  box-shadow: var(--shadow-lg);
}
.map-node:active .node-circle {
  transform: translateY(-2px) scale(1.02);
}

/* Phase color states */
.map-node[data-phase="engage"] .node-circle { --phase-color: var(--phase-engage); --phase-bg: var(--phase-engage-light); }
.map-node[data-phase="explore"] .node-circle { --phase-color: var(--phase-explore); --phase-bg: var(--phase-explore-light); }
.map-node[data-phase="explain"] .node-circle { --phase-color: var(--phase-explain); --phase-bg: var(--phase-explain-light); }
.map-node[data-phase="elaborate"] .node-circle { --phase-color: var(--phase-elaborate); --phase-bg: var(--phase-elaborate-light); }
.map-node[data-phase="evaluate"] .node-circle { --phase-color: var(--phase-evaluate); --phase-bg: var(--phase-evaluate-light); }

/* Visited state */
.map-node.visited .node-circle {
  border-color: var(--phase-color);
  background: var(--phase-bg);
}
.map-node.visited .node-circle .node-step {
  color: var(--phase-color);
}

/* Active/current state */
.map-node.active .node-circle {
  border-color: var(--phase-color);
  background: var(--phase-bg);
  transform: scale(1.1);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--phase-color) 20%, transparent), var(--shadow-lg);
}
.map-node.active .node-circle .node-step {
  color: var(--phase-color);
}
.map-node.active:hover .node-circle {
  transform: scale(1.12) translateY(-4px);
}

/* Future/faded state */
.map-node.future .node-circle {
  opacity: 0.5;
}
.map-node.future .node-label { opacity: 0.5; }

/* Pulse on active */
@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--phase-color) 20%, transparent), var(--shadow-lg); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--phase-color) 10%, transparent), var(--shadow-lg); }
}
.map-node.active .node-circle {
  animation: node-pulse 2.5s ease-in-out infinite;
}

/* Node label */
.node-label {
  text-align: center;
  max-width: 140px;
}
.node-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.node-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.3;
}

/* Duration badge */
.node-duration {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  margin-top: var(--space-1);
}
.node-duration svg {
  width: 12px;
  height: 12px;
  display: inline;
}

/* --- Navigation arrows --- */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition:
    background var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive),
    opacity var(--transition-interactive);
}
.nav-arrow:hover {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-lg);
}
.nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}
.nav-arrow:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.nav-arrow--prev { left: var(--space-4); }
.nav-arrow--next { right: var(--space-4); }

/* --- Detail overlay & panel --- */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-overlay.open {
  pointer-events: auto;
  opacity: 1;
}
.detail-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 300ms ease;
}
.detail-overlay.open::before {
  opacity: 1;
}
[data-theme='dark'] .detail-overlay::before {
  background: rgba(0,0,0,0.55);
}

.detail-panel {
  position: relative;
  width: 460px;
  max-width: 100%;
  background: var(--detail-bg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}
.detail-overlay.open .detail-panel {
  transform: translateX(0);
}
.detail-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.detail-close:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* Detail content */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.detail-title-group {
  flex: 1;
  min-width: 0;
}
.detail-phase-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
}
.detail-phase-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-1);
}
.detail-phase-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.detail-section {
  margin-bottom: var(--space-6);
}
.detail-section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.detail-section-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.detail-description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
}

/* TIC tags */
.tic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tic-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  border: 1px solid var(--color-divider);
}
.tic-tag svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Duration badge in detail */
.detail-duration {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-display);
}
.detail-duration svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Detail illustration */
.detail-illustration {
  width: 100%;
  margin: var(--space-6) 0 var(--space-4);
  display: flex;
  justify-content: center;
}
.detail-illustration svg {
  max-width: 200px;
  height: auto;
  color: var(--color-primary);
  opacity: 0.15;
}

/* Detail nav arrows */
.detail-nav {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.detail-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-divider);
  transition: background var(--transition-interactive), border-color var(--transition-interactive);
  min-height: 44px;
}
.detail-nav-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.detail-nav-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.detail-nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Swipe hint --- */
.swipe-hint {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: none; /* shown via JS on mobile */
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  z-index: 50;
  animation: hint-fade 3s ease forwards;
  pointer-events: none;
}
.swipe-hint.visible {
  display: flex;
}
@keyframes hint-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* --- Entry animations --- */
@keyframes node-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.map-node {
  opacity: 0;
  animation: node-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.map-node:nth-child(1) { animation-delay: 100ms; }
.map-node:nth-child(2) { animation-delay: 200ms; }
.map-node:nth-child(3) { animation-delay: 300ms; }
.map-node:nth-child(4) { animation-delay: 400ms; }
.map-node:nth-child(5) { animation-delay: 500ms; }

/* --- Responsive / Mobile --- */
@media (max-width: 768px) {
  .header-title { font-size: var(--text-sm); }
  .back-btn span { display: none; }

  .breadcrumb-label { font-size: 0.65rem; }
  .breadcrumb-line { min-width: 8px; max-width: 24px; }

  .map-container {
    height: calc(100dvh - 48px - 48px);
  }

  /* Vertical layout on mobile */
  .map-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    flex-direction: column;
    align-items: center;
    scroll-snap-type: y mandatory;
  }
  .map-nodes {
    flex-direction: column;
    padding: var(--space-10) var(--space-6);
    gap: var(--space-12);
    min-width: unset;
    width: 100%;
    align-items: center;
  }
  .map-node {
    scroll-snap-align: center;
  }
  .node-circle {
    width: var(--node-size-mobile);
    height: var(--node-size-mobile);
  }
  .node-circle .node-emoji { font-size: 1.6rem; }

  /* Nav arrows horizontal → vertical */
  .nav-arrow--prev {
    top: auto;
    bottom: var(--space-4);
    left: var(--space-4);
    transform: none;
  }
  .nav-arrow--next {
    top: auto;
    bottom: var(--space-4);
    right: var(--space-4);
    transform: none;
  }
  .nav-arrow:active {
    transform: scale(0.95);
  }

  /* Detail panel: slide from bottom */
  .detail-overlay {
    align-items: flex-end;
    justify-content: stretch;
  }
  .detail-panel {
    width: 100%;
    max-height: 85dvh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    transform: translateY(100%);
    padding: var(--space-6);
  }
  .detail-overlay.open .detail-panel {
    transform: translateY(0);
  }

  .detail-phase-title {
    font-size: var(--text-lg);
  }
  .detail-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

@media (max-width: 380px) {
  .breadcrumb-label { display: none; }
  .breadcrumb-dot { width: 12px; height: 12px; }
}

/* --- SVG path animation on load --- */
@keyframes draw-path {
  from { stroke-dashoffset: var(--path-length, 2000); }
  to { stroke-dashoffset: 0; }
}
.connecting-path.animate-draw {
  stroke-dasharray: var(--path-length, 2000);
  stroke-dashoffset: var(--path-length, 2000);
  animation: draw-path 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}
.connecting-path-bg.animate-draw {
  stroke-dasharray: 12 8;
  animation: dash-march 2s linear infinite;
}
