<style scoped>
/* ─── Reset & Root ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.radial-explorer {
  font-family: "NotesEsa", system-ui, sans-serif;
  background: #0a0c14;
  color: #f0f0f7;
  width: 100%;
  /* min-height: 100vh; */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 12, 20, 0.95);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  gap: 24px;
  flex-wrap: wrap;
}

.title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1;
  color: #ffffff;
}
.title-sep {
  color: rgba(255, 255, 255, 0.45);
  margin: 0 4px;
}
.title-full {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}
.accent {
  color: #5ba3d0;
}
.subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  font-family: "NotesEsa", monospace;
  letter-spacing: 0.3px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Status filter */
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-family: "NotesEsa", monospace;
  white-space: nowrap;
  letter-spacing: 0.4px;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-family: "NotesEsa", system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.status-pill:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}
.status-pill.on {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ─── Main area ──────────────────────────────────────────────────────────────── */
.main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ─── Chart ──────────────────────────────────────────────────────────────────── */
.chart-container {
  flex: 1 1 0%;
  min-width: 0; /* allow flex item to shrink below content's natural size */
  min-height: 800px;
  display: flex;
  align-items: flex-start; /* hug the top of the available area */
  justify-content: center;
  padding: 4px 8px 0;
  transition: all 0.4s ease;
}

.radial-svg {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 100%;
  overflow: visible;
  display: block;
}

/* Arc interactions */
.arc-group {
  cursor: pointer;
}
.arc-path {
  transition:
    opacity 0.35s ease,
    stroke 0.2s ease;
}
.arc-group:hover .arc-path {
  filter: brightness(1.25);
}
.arc-label {
  pointer-events: none;
  font-family: "NotesEsa", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.1px;
  dominant-baseline: middle;
  transition: opacity 0.35s ease;
}
.center-label {
  pointer-events: none;
}
.center-alliance-label {
  font-size: 1rem;
  font-family: "NotesEsa", system-ui, sans-serif;
  font-weight: 500;
  fill: #ffffff;
  letter-spacing: 0.2px;
  dominant-baseline: middle;
}

/* Group band (outer thin ring) */
.band-path {
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.band-path:hover {
  opacity: 0.9 !important;
}
.band-label {
  cursor: pointer;
  font-family: "NotesEsa", monospace;
  dominant-baseline: middle;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: fill 0.2s ease;
}
.band-label:hover {
  fill: #fff;
}
.band-line {
  pointer-events: none;
  transition: stroke-opacity 0.25s ease;
}

/* ─── Info Panel ─────────────────────────────────────────────────────────────── */
.info-panel {
  width: clamp(280px, 28vw, 360px);
  background: rgba(14, 16, 26, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  padding: 28px 24px 24px;
  overflow-y: auto;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.panel-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.panel-flagship-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 10px;
  font-family: "NotesEsa", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  width: fit-content;
}

.panel-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
}
.panel-title-link {
  color: inherit;
  text-decoration: none;
}
.panel-title-link:hover {
  text-decoration: underline;
}

.panel-tier {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tier-badge,
.status-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-family: "NotesEsa", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tier-1 {
  background: rgba(91, 163, 208, 0.2);
  color: #b8dcef;
}
.tier-2 {
  background: rgba(232, 168, 76, 0.2);
  color: #f0d4a0;
}
.status-active {
  background: rgba(127, 186, 99, 0.22);
  color: #d6ebc4;
}
.status-preparation {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}
.status-completed {
  background: rgba(129, 151, 166, 0.25);
  color: #c9d3da;
}

.panel-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.children-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.65);
  font-family: "NotesEsa", monospace;
  margin-bottom: 4px;
}
.child-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s;
}
.child-item:not(.child-item--static) {
  cursor: pointer;
}
.child-item:not(.child-item--static):hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.child-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Legend ─────────────────────────────────────────────────────────────────── */
.legend-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 12, 20, 0.95);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.legend-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.7);
  font-family: "NotesEsa", monospace;
  margin-right: 6px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s;
}
.legend-item:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}
.legend-item.active {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.legend-count {
  font-family: "NotesEsa", monospace;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 2px;
}

/* ─── Panel transition ───────────────────────────────────────────────────────── */
.panel-slide-enter-active,
.panel-slide-leave-active {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-slide-enter-from,
.panel-slide-leave-to {
  transform: translateX(100%);
  opacity: 0;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
.info-panel::-webkit-scrollbar {
  width: 4px;
}
.info-panel::-webkit-scrollbar-track {
  background: transparent;
}
.info-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
/* Tablet: tighten the header and chart padding */
@media (max-width: 960px) {
  .explorer-header {
    padding: 14px 18px 12px;
    gap: 14px;
  }
  .title {
    font-size: 18px;
  }
  .header-controls {
    gap: 12px;
  }
  .chart-container {
    padding: 8px;
  }
  .legend-bar {
    padding: 10px 14px;
    gap: 6px;
  }
}

/* Keep the mobile canvas in the same proportion as the SVG viewBox. */
@media (max-width: 991.98px) {
  .chart-container {
    /* Do not let flexbox stretch this area to the remaining viewport height. */
    display: block;
    flex: none;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 1100 / 820;
    overflow: hidden;
    padding: 0;
  }

  .radial-svg {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }
}

/* Narrow: stack chart over a bottom-sheet info panel; header wraps freely */
@media (max-width: 720px) {
  .main-area {
    flex-direction: column;
  }

  .info-panel {
    width: 100%;
    max-height: 55vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 22px 18px 18px;
  }

  /* Slide the bottom-sheet panel up from the bottom instead of from the right */
  .panel-slide-enter-from,
  .panel-slide-leave-to {
    transform: translateY(100%);
    opacity: 0;
  }

  .title-full {
    display: none;
  } /* keep just the acronym */
  .title-sep {
    display: none;
  }
  .subtitle {
    display: none;
  }

  .legend-bar {
    font-size: 10px;
  }
  .legend-item {
    padding: 4px 9px;
    font-size: 10.5px;
  }
}

/* Phone: header items wrap on their own rows, chart sized for portrait */
@media (max-width: 480px) {
  .explorer-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .header-controls {
    width: 100%;
    gap: 10px;
  }
  .filter-group {
    flex-wrap: wrap;
  }
  .info-panel {
    max-height: 60vh;
    padding: 18px 14px 14px;
  }
}
