/* Graphical results dashboard – Free overview + Pro detail */

body.rd-open {
  overflow: hidden;
}

.rd-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  overflow: auto;
  background: #0b0e14;
  color: #e8eaf0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.rd-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.rd-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rd-header__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.rd-header__brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.rd-header__sub {
  width: 100%;
  font-size: 0.75rem;
  opacity: 0.65;
}

.rd-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rd-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.7rem;
  opacity: 0.55;
  justify-content: center;
}

.rd-steps .is-active {
  opacity: 1;
  color: #a5b4fc;
  font-weight: 600;
}

.rd-header__secure {
  text-align: right;
  font-size: 0.72rem;
  opacity: 0.7;
}

.rd-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 0;
}

.rd-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #e8eaf0;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rd-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rd-btn.is-active {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.25);
}

.rd-btn--primary {
  background: #6366f1;
  border-color: #6366f1;
  font-weight: 600;
}

.rd-btn--primary:hover {
  background: #4f46e5;
}

.rd-btn--secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  font-weight: 500;
}

.rd-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.rd-btn--secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
}

.rd-btn--locked {
  opacity: 0.55;
}

.rd-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.rd-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr minmax(240px, 300px);
  gap: 1rem;
  align-items: start;
}

.rd-card {
  background: rgba(18, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.rd-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c7d2fe;
}

.rd-card h4 {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.rd-dl {
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.rd-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.25rem;
}

.rd-dl dt {
  opacity: 0.55;
}

.rd-dl dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

.rd-dept-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
}

.rd-dept-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-left: 3px solid #94a3b8;
  padding-left: 0.5rem;
  margin-bottom: 0.25rem;
}

.rd-dept-list li.is-high { border-color: #4ade80; }
.rd-dept-list li.is-medium { border-color: #facc15; }
.rd-dept-list li.is-low { border-color: #f87171; }

.rd-dept-meta {
  opacity: 0.65;
  font-size: 0.7rem;
  white-space: nowrap;
}

.rd-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.68rem;
}

.rd-legend span::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.rd-legend .is-high::before { background: #4ade80; }
.rd-legend .is-medium::before { background: #facc15; }
.rd-legend .is-low::before { background: #f87171; }

/* Company wheel */
.rd-wheel-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
}

.rd-wheel {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.rd-wheel__hub {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1e2433, #0f131c 70%);
  border: 2px solid rgba(129, 140, 248, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
  z-index: 2;
}

.rd-wheel__hub-label {
  font-size: 0.7rem;
  opacity: 0.7;
}

.rd-wheel__score {
  font-size: 2.4rem;
  line-height: 1.1;
  color: #4ade80;
  margin: 0.15rem 0;
}

.rd-wheel__score-cap {
  font-size: 0.65rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rd-wheel__pot {
  font-size: 0.68rem;
  margin-top: 0.35rem;
  opacity: 0.85;
}

.rd-wheel__pot b {
  color: #4ade80;
  font-weight: 600;
}

.rd-wheel__node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--a)) translate(155px) rotate(calc(-1 * var(--a)));
  z-index: 1;
}

.rd-wheel__bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  min-height: 96px;
  border-radius: 50%;
  background: #151a26;
  border: 2px solid #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem;
  font-size: 0.62rem;
  line-height: 1.2;
}

.rd-wheel__node.is-high .rd-wheel__bubble { border-color: #4ade80; }
.rd-wheel__node.is-medium .rd-wheel__bubble { border-color: #facc15; }
.rd-wheel__node.is-low .rd-wheel__bubble { border-color: #f87171; }

.rd-wheel__bubble strong {
  font-size: 0.65rem;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-wheel__bubble em {
  font-style: normal;
  opacity: 0.75;
}

.rd-wheel__count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 0.58rem;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-gauge {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.rd-gauge strong {
  font-size: 2rem;
  color: #4ade80;
}

.rd-gauge span {
  font-size: 0.8rem;
  color: #86efac;
}

.rd-muted {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.65;
}

.rd-table-wrap {
  overflow: auto;
  max-height: 220px;
}

.rd-table-wrap--wide {
  max-height: 360px;
}

.rd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.rd-table th,
.rd-table td {
  padding: 0.35rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rd-table th {
  opacity: 0.55;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #121620;
}

.rd-pct {
  color: #4ade80;
  font-weight: 600;
}

.rd-ideas {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.rd-bottom {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.rd-tops {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
}

.rd-tops li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0;
}

.rd-tops em {
  margin-left: auto;
  font-style: normal;
  color: #4ade80;
  font-size: 0.72rem;
}

.rd-rank {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.rd-metrics {
  display: grid;
  gap: 0.65rem;
}

.rd-metrics > div {
  display: flex;
  flex-direction: column;
}

.rd-metrics strong {
  font-size: 1.15rem;
  color: #a5b4fc;
}

.rd-metrics span {
  font-size: 0.7rem;
  opacity: 0.6;
}

.rd-bars {
  display: grid;
  gap: 0.45rem;
  font-size: 0.72rem;
}

.rd-bar {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.2rem;
  align-items: center;
  gap: 0.4rem;
}

.rd-bar__track {
  height: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.rd-bar__track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4ade80);
  border-radius: inherit;
}

.rd-bar em {
  font-style: normal;
  text-align: right;
  opacity: 0.75;
}

.rd-steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
}

.rd-steps-list li {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
}

.rd-steps-list span {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #6366f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}

/* Detail (Pro/Ultimate) */
.rd-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rd-kpis > div {
  background: rgba(18, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}

.rd-kpis strong {
  display: block;
  font-size: 1.05rem;
  color: #a5b4fc;
}

.rd-kpis span {
  font-size: 0.68rem;
  opacity: 0.6;
}

.rd-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.7rem;
}

.rd-pill.is-high { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.rd-pill.is-medium { background: rgba(250, 204, 21, 0.2); color: #facc15; }
.rd-pill.is-low { background: rgba(248, 113, 113, 0.2); color: #f87171; }

.rd-tech {
  color: #7dd3fc;
  font-size: 0.68rem;
}

.rd-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .rd-grid {
    grid-template-columns: 1fr;
  }

  .rd-bottom {
    grid-template-columns: 1fr 1fr;
  }

  .rd-header {
    grid-template-columns: 1fr;
  }

  .rd-header__secure {
    text-align: left;
  }

  .rd-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .rd-wheel__node {
    transform: rotate(var(--a)) translate(130px) rotate(calc(-1 * var(--a)));
  }
}

@media (max-width: 640px) {
  .rd-bottom {
    grid-template-columns: 1fr;
  }

  .rd-wheel {
    width: min(100%, 320px);
  }

  .rd-wheel__node {
    transform: rotate(var(--a)) translate(110px) rotate(calc(-1 * var(--a)));
  }

  .rd-wheel__bubble {
    width: 78px;
    min-height: 78px;
  }
}
