html,
body.qct-page {
  height: 100%;
}

.qct-page {
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.qct-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--er-t-border);
  background: rgba(8, 18, 13, 0.96);
  flex-shrink: 0;
}

.qct-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--er-t-gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}

.qct-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.qct-analytics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.65rem;
  border-bottom: 1px solid var(--er-t-border);
  background: rgba(14, 26, 20, 0.72);
  flex-shrink: 0;
}

.qct-kpi {
  background: rgba(8, 18, 13, 0.7);
  border: 1px solid var(--er-t-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem 0.5rem;
}

.qct-kpi .k {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--er-t-muted);
}

.qct-kpi .v {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--er-t-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--er-t-gold);
}

.qct-kpi .s {
  display: block;
  font-size: 0.68rem;
  color: var(--er-t-muted);
}

.qct-kpi.is-on {
  border-color: rgba(196, 163, 90, 0.55);
}

.qct-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.qct-nav {
  width: 248px;
  flex-shrink: 0;
  border-right: 1px solid var(--er-t-border);
  background: rgba(8, 18, 13, 0.88);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.qct-nav-head {
  padding: 0.55rem 0.65rem 0.4rem;
  border-bottom: 1px solid var(--er-t-border);
}

.qct-search-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--er-t-muted);
  margin-bottom: 0.25rem;
}

.qct-nav-list {
  overflow: auto;
  padding: 0.35rem 0.4rem 0.8rem;
}

.qct-sura-btn {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  margin: 0 0 0.22rem;
  padding: 0.38rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.qct-sura-btn:hover,
.qct-sura-btn.is-on {
  background: rgba(196, 163, 90, 0.1);
  border-color: rgba(196, 163, 90, 0.35);
}

.qct-sura-btn .n {
  font-family: var(--er-t-mono);
  font-size: 0.72rem;
  color: var(--er-t-gold);
}

.qct-sura-btn .nm {
  font-size: 0.8rem;
  line-height: 1.2;
}

.qct-sura-btn .meta {
  font-size: 0.62rem;
  color: var(--er-t-muted);
}

.qct-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.qct-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem 0.4rem;
  border-bottom: 1px solid var(--er-t-border);
}

.qct-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--er-t-muted);
}

.qct-frame-head h2 {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
}

.qct-frame-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.qct-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem;
  border: 1px solid var(--er-t-border);
  border-radius: 8px;
  background: rgba(8, 18, 13, 0.45);
}

.qct-zoom .er-tbtn {
  min-width: 2rem;
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.qct-zoom-label {
  min-width: 2.8rem;
  text-align: center;
  font-size: 0.72rem;
  font-family: var(--er-t-mono);
  color: #e8d5a3;
}

.qct-stage {
  flex: 1;
  min-height: 36rem;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.qct-map-row {
  flex: 1 1 auto;
  min-height: 36rem;
  display: flex;
  align-items: stretch;
}

.qct-map-wrap {
  flex: 1;
  min-width: 0;
  min-height: 36rem;
  overflow: auto;
  background:
    radial-gradient(ellipse 40% 50% at 50% 50%, rgba(196, 163, 90, 0.08), transparent 70%);
}

.qct-map-zoom {
  transform-origin: 50% 0;
  min-height: 36rem;
}

.qct-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 36rem;
}

.qct-drill {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #0a1510;
}

.qct-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a1510;
}

.qct-edge {
  fill: none;
  stroke: rgba(196, 163, 90, 0.42);
  stroke-width: 1.2;
}

.qct-hub circle {
  fill: #c4a35a;
  stroke: rgba(243, 239, 230, 0.4);
  stroke-width: 1.4;
}

.qct-hub .num {
  fill: #0e1a14;
  font-family: var(--er-t-mono);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.qct-caption {
  fill: #f3efe6;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: #08120e;
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.qct-caption.is-leaf {
  font-size: 8.5px;
  font-weight: 500;
  fill: #e8d5a3;
}

.qct-branch {
  cursor: pointer;
}

.qct-branch circle {
  fill: #143328;
  stroke: #6b9e86;
  stroke-width: 1.4;
}

.qct-branch.is-on circle,
.qct-branch:hover circle {
  fill: #c4a35a;
  stroke: #f3efe6;
}

.qct-leaf {
  cursor: pointer;
}

.qct-leaf circle {
  fill: #0e1a14;
  stroke: rgba(196, 163, 90, 0.75);
  stroke-width: 1.3;
}

.qct-leaf.is-on circle,
.qct-leaf:hover circle {
  fill: #c4a35a;
  stroke: #f3efe6;
}

.qct-focus {
  width: 26rem;
  min-width: 22rem;
  flex-shrink: 0;
  border-left: 1px solid var(--er-t-border);
  padding: 0.75rem 1rem 1.1rem;
  overflow: auto;
  background: rgba(8, 18, 13, 0.55);
}

.qct-focus h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.qct-focus-empty {
  margin: 0;
  color: var(--er-t-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.qct-focus .qct-focus-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--er-t-gold);
}

.qct-focus .qct-focus-body,
.qct-focus-note {
  display: block;
  width: 100%;
  margin: 0 0 0.7rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d7e2db;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.qct-focus-note {
  cursor: pointer;
  padding: 0.45rem 0.15rem;
  border-radius: 8px;
}

.qct-focus-note:hover,
.qct-focus-note.is-on {
  background: rgba(196, 163, 90, 0.08);
}

.er-tbtn.is-on {
  border-color: rgba(196, 163, 90, 0.7);
  color: var(--er-t-gold);
}

@media (max-width: 900px) {
  .qct-body { flex-direction: column; }
  .qct-nav { width: 100%; max-height: 12rem; border-right: 0; border-bottom: 1px solid var(--er-t-border); }
  .qct-map-row { flex-direction: column; min-height: 28rem; }
  .qct-focus { width: 100%; border-left: 0; border-top: 1px solid var(--er-t-border); max-height: 14rem; }
}
