:root {
  --qc-bg: #08120e;
  --qc-panel: #0e1a14;
  --qc-border: rgba(196, 163, 90, 0.22);
  --qc-text: #f3efe6;
  --qc-muted: rgba(243, 239, 230, 0.62);
  --qc-gold: #c4a35a;
  --qc-axis: #c4785a;
  --qc-font: "Outfit", sans-serif;
  --qc-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
}
body.qc-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 45% at 12% 0%, rgba(196, 163, 90, 0.12), transparent 55%),
    linear-gradient(165deg, #06100c 0%, #0e1a14 55%, #08120e 100%);
  color: var(--qc-text);
  font-family: var(--qc-font);
}

.qc-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--qc-border);
  background: rgba(8, 18, 13, 0.92);
}
.qc-brand {
  color: var(--qc-gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.qc-top h1 {
  margin: 0.2rem 0 0.15rem;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
}
.qc-sub {
  margin: 0;
  color: var(--qc-muted);
  font-size: 0.78rem;
}
.qc-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.qc-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--qc-border);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  color: var(--qc-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
}
.qc-btn:hover {
  border-color: rgba(196, 163, 90, 0.5);
  background: rgba(196, 163, 90, 0.1);
}
.qc-btn.is-on {
  background: rgba(196, 163, 90, 0.2);
  border-color: rgba(196, 163, 90, 0.55);
  color: #e8d5a3;
}

.qc-stage {
  position: relative;
  min-height: 0;
  padding: 0.35rem 0.5rem 0.25rem;
}
.qc-chart {
  display: block;
  width: 100%;
  height: 100%;
}
.qc-status {
  position: absolute;
  left: 1rem;
  top: 1rem;
  margin: 0;
  font-family: var(--qc-mono);
  font-size: 0.78rem;
  color: var(--qc-muted);
}

.qc-axis {
  stroke: var(--qc-axis);
  stroke-width: 2.5;
}
.qc-tick {
  stroke: rgba(196, 120, 90, 0.7);
  stroke-width: 1.5;
}
.qc-tick-label,
.qc-axis-title {
  fill: var(--qc-muted);
  font-family: var(--qc-mono);
  font-size: 11px;
}
.qc-axis-title {
  fill: rgba(243, 239, 230, 0.78);
  font-size: 12px;
  font-family: var(--qc-font);
  font-weight: 600;
}

.qc-bubble {
  cursor: pointer;
  outline: none;
}
.qc-bubble circle {
  stroke: rgba(8, 18, 13, 0.35);
  stroke-width: 1;
  transition: r 0.15s ease, stroke-width 0.15s ease;
}
.qc-bubble:hover circle,
.qc-bubble:focus-visible circle,
.qc-bubble.is-on circle {
  stroke: #f3efe6;
  stroke-width: 2.5;
  filter: brightness(1.08);
}
.qc-bubble-id {
  fill: #fff8f0;
  font-family: var(--qc-mono);
  font-weight: 700;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(8, 18, 13, 0.55);
  stroke-width: 2.5px;
}
.qc-bubble-label {
  fill: #f8f4ea;
  font-family: var(--qc-mono);
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(8, 18, 13, 0.75);
  stroke-width: 3px;
}

.qc-drill {
  position: fixed;
  right: 1rem;
  bottom: 2.4rem;
  z-index: 30;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--qc-border);
  border-radius: 14px;
  background: rgba(14, 26, 20, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.qc-drill-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--qc-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}
.qc-drill-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qc-muted);
}
.qc-drill h2 {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.15rem;
  padding-right: 1.4rem;
}
.qc-drill-meta {
  margin: 0;
  color: var(--qc-muted);
  font-size: 0.85rem;
}
.qc-drill-verses {
  margin: 0.55rem 0 0.75rem;
  font-family: var(--qc-mono);
  font-size: 0.95rem;
  color: #e8d5a3;
}
.qc-drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qc-foot {
  padding: 0.45rem 1.1rem;
  border-top: 1px solid var(--qc-border);
  color: var(--qc-muted);
  font-size: 0.7rem;
  text-align: center;
}
.qc-foot a { color: var(--qc-gold); }

@media (max-width: 720px) {
  .qc-top { flex-direction: column; }
  .qc-bubble-label { font-size: 9px; }
  .qc-drill {
    left: 0.65rem;
    right: 0.65rem;
    width: auto;
    bottom: 2.2rem;
  }
}
