/* ─── Shared panel base ──────────────────────────────────────────────────── */
:root {
  --cd-top:    calc(var(--header-h) );
  --cd-height: calc(100vh - var(--header-h) - var(--footer-h) - 32px);
  --cd-width:  360px;
  --cd-left:   16px;
}

.cd-overlay,
.cd-sub-panel {
  position: fixed;
  top: var(--cd-top);
  width: var(--cd-width);
  max-height: var(--cd-height);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: scroll;
  background: #0f0f1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}

/* ─── Main panel ─────────────────────────────────────────────────────────── */
.cd-overlay {
  display: none;
  left: var(--cd-left);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cd-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* fading transition between main sections */
.cd-overlay.fading { opacity: 0; }

/* ─── Shared header ──────────────────────────────────────────────────────── */
.cd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  background: #11111c;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}


.cd-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cd-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cd-btn-prev {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  border-radius: 6px;
  width: 34px; height: 34px;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.cd-btn-prev:hover:not(:disabled) {
  color: #fff;
  border-color: #8b7cf6;
}
.cd-btn-prev:disabled { opacity: 0.2; cursor: default; }

.cd-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-progress-dots {
  display: flex;
  gap: 5px;
}

.cd-progress-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.25s, transform 0.25s;
}
.cd-progress-dots .dot.active {
  background: #8b7cf6;
  transform: scale(1.35);
}
.cd-progress-dots .dot.done {
  background: rgba(139,124,246,0.35);
}

.cd-section-counter {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

.cd-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cd-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.cd-isi-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.cd-isi-btn:hover {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
}

/* ─── Content area ───────────────────────────────────────────────────────── */
.cd-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px;
  scroll-behavior: smooth;
  min-height: 0;
}

.cd-screen-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.3;
}

/* ─── Content blocks ─────────────────────────────────────────────────────── */
.cd-block { margin-bottom: 20px; }

.cd-block-text {
  font-size: 16px;
  line-height: 1.7;
  color: #c8c8d8;
  max-width: 700px;
}

.cd-block-heading {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.cd-block-callout {
  background: rgba(139,124,246,0.1);
  border-left: 3px solid #8b7cf6;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  color: #d0cbff;
  max-width: 700px;
}

.cd-block-footnote {
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  max-width: 700px;
}

.cd-block-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  background: #13131f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 22px 28px;
  min-width: 180px;
}
.cd-block-stat .cd-stat-value {
  font-size: 40px;
  font-weight: 800;
  color: #8b7cf6;
  line-height: 1;
  letter-spacing: -0.02em;
}
.cd-block-stat .cd-stat-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  max-width: 260px;
  line-height: 1.4;
}

.cd-block-stat-group { display: flex; flex-direction: column; gap: 8px; max-width: 680px; }
.cd-sg-header {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 2px;
}
.cd-sg-header span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
}
.cd-sg-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  align-items: center;
  gap: 12px;
  background: #13131f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 12px 16px;
}
.cd-sg-label { font-size: 13px; color: #c8c8d8; }
.cd-sg-val { text-align: center; font-size: 22px; font-weight: 700; line-height: 1; }
.cd-sg-val.emp { color: #5fcb96; }
.cd-sg-val.pbo { color: rgba(255,255,255,0.25); }

.cd-block-bullets { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.cd-block-bullets li {
  list-style: none;
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #c8c8d8;
}
.cd-block-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--secondary);
}

/* Sub-bullets: nest a <ul> inside a bullet string, e.g.
   "Parent item<ul><li>Child item</li></ul>" */
.cd-block-bullets li > ul {
  list-style: none;
  margin: 8px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-block-bullets li > ul > li {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.cd-block-bullets li > ul > li::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.cd-block-asset {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #13131f;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 32px;
  max-width: 680px;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
}
.cd-block-asset .cd-asset-icon { font-size: 22px; }
.cd-block-asset code {
  font-family: monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
}

.cd-block-summary { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.cd-summary-section {
  background: #13131f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 14px 18px;
}
.cd-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8b7cf6;
  margin-bottom: 4px;
}
.cd-summary-key { font-size: 13px; color: rgba(255,255,255,0.3); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.cd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  padding: 10px 16px;
  background: #11111c;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.cd-footer-subs { display: flex; flex-wrap: wrap; gap: 8px; }

.cd-btn-sub {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  color: #c8c8d8;
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.cd-btn-sub:hover {
  border-color: #8b7cf6;
  background: rgba(139,124,246,0.1);
  color: #fff;
}

.cd-btn-next {
  background: #8b7cf6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.cd-btn-next::after { content: '→'; }
.cd-btn-next:hover { opacity: 0.85; }

/* ─── Subsection panel (second popup to the right) ───────────────────────── */
.cd-sub-panel {
  left: calc(var(--cd-left) + var(--cd-width) + 12px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cd-sub-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.cd-sub-panel .cd-header { border-radius: 12px 12px 0 0; }

.cd-btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: rgba(139,124,246,0.15);
  border: 1px solid rgba(139,124,246,0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cd-btn-back:hover {
  background: rgba(139,124,246,0.3);
  border-color: #8b7cf6;
}

.cd-back-arrow {
  color: #8b7cf6;
  font-size: 16px;
  line-height: 1;
}

.cd-sub-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
