/* ============================================================
   NEXORA · Component / Learning component viewer styles
   ============================================================ */

.cv {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  box-shadow: var(--depth), var(--glass-edge);
}

.cv-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cv-modes {
  display: flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

.cv-mode {
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  cursor: pointer;
}

.cv-mode-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cv-mode.is-active {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 4px 12px -6px var(--glow-accent);
}

.cv-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
}

.cv-tools { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }

.cv-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.34rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  cursor: pointer;
}

.cv-tool .icon { width: 0.9em; height: 0.9em; }
.cv-tool:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.08); }
.cv-tool.is-on { color: var(--accent-2); background: rgba(47, 210, 242, 0.12); }

.cv-zoom { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); min-width: 40px; text-align: center; }

/* ---------- stage -------------------------------------------- */

.cv-stage-wrap {
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(106, 99, 255, 0.08), transparent 65%),
    rgba(3, 6, 16, 0.22);
}

[data-theme="light"] .cv-stage-wrap { background: rgba(240, 243, 250, 0.7); }

.cv-stage { padding: 1.2rem; }

.cv-svg {
  width: 100%;
  height: auto;
  max-height: 460px;
  display: block;
  overflow: visible;
}

.cv-art { transition: transform var(--dur) var(--ease-out); }

/* hotspots */
.cv-hot { cursor: pointer; outline: none; }

.cv-hot-rect {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  transition: fill 0.15s, stroke 0.15s;
}

.cv-hot:hover .cv-hot-rect,
.cv-hot:focus-visible .cv-hot-rect {
  fill: rgba(47, 210, 242, 0.14);
  stroke: var(--accent-2);
  stroke-dasharray: 5 4;
}

.cv-hot.is-sel .cv-hot-rect {
  fill: rgba(106, 99, 255, 0.18);
  stroke: var(--accent);
  stroke-dasharray: none;
}

.cv-hot-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--accent-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 3px;
}

.cv-hot:hover .cv-hot-label,
.cv-hot:focus-visible .cv-hot-label,
.cv-hot.is-sel .cv-hot-label { opacity: 1; }

.cv.hide-labels .cv-hot-label { display: none; }

/* pin dots */
.cv-pin { cursor: pointer; outline: none; }

.cv-pin-dot {
  fill: rgba(47, 210, 242, 0.001);
  stroke: transparent;
  stroke-width: 2;
  transition: fill 0.15s, stroke 0.15s;
}

.cv-pin:hover .cv-pin-dot,
.cv-pin:focus-visible .cv-pin-dot {
  fill: rgba(47, 210, 242, 0.3);
  stroke: var(--accent-2);
}

.cv-pin.is-sel .cv-pin-dot { fill: rgba(255, 201, 77, 0.4); stroke: var(--gold); }

/* component internal text classes */
.lc-mini { font-family: var(--font-mono); font-size: 11px; fill: var(--text-3); }
.lc-chip { font-family: var(--font-mono); font-size: 13px; fill: #9aa6b2; }
.lc-pinlabel { font-family: var(--font-mono); font-size: 11px; fill: #cfe4e8; }
.lc-brand { font-family: var(--font-display); font-size: 26px; font-weight: 700; fill: #e8f6f8; letter-spacing: 3px; }
.lc-brand-sub { font-family: var(--font-mono); font-size: 14px; fill: #bcdde1; letter-spacing: 5px; }

/* ---------- dedicated 3D inspection window -------------------- */

.cv3d-dialog {
  width: min(1440px, calc(100vw - 28px));
  height: min(900px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%);
  border-radius: 18px;
  background: var(--bg-elevated);
  color: var(--text-1);
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5), var(--glass-edge);
}

.cv3d-dialog::backdrop {
  background: rgba(2, 5, 14, 0.78);
  backdrop-filter: blur(10px) saturate(0.8);
}

.cv3d-dialog[open] { animation: cv3d-fade-in 0.16s ease-out both; }

@keyframes cv3d-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cv3d-window {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 120px),
    var(--bg-elevated);
}

.cv3d-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}

.cv3d-back,
.cv3d-icon-btn,
.cv3d-tool {
  border: 1px solid transparent;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}

.cv3d-back {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.cv3d-back:hover,
.cv3d-icon-btn:hover,
.cv3d-tool:hover {
  color: var(--text-1);
  background: rgba(255,255,255,0.065);
  border-color: var(--border);
}

.cv3d-heading { min-width: 0; }
.cv3d-heading .micro { color: var(--accent-2); }
.cv3d-heading h2 {
  margin: 0.12rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.cv3d-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cv3d-status {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(47,210,242,0.22);
  background: rgba(47,210,242,0.075);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  white-space: nowrap;
}

.cv3d-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
}

.cv3d-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
}

.cv3d-viewport-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(900px 520px at 50% 45%, rgba(106,99,255,0.10), transparent 64%),
    linear-gradient(180deg, rgba(3,6,16,0.84), rgba(6,10,22,0.94));
}

[data-theme="light"] .cv3d-viewport-wrap {
  background:
    radial-gradient(900px 520px at 50% 45%, rgba(106,99,255,0.09), transparent 64%),
    linear-gradient(180deg, rgba(245,247,252,0.98), rgba(232,237,246,0.98));
}

.cv3d-viewport {
  position: relative;
  min-width: 0;
  min-height: 420px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cv3d-viewport.is-dragging { cursor: grabbing; }

.cv3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cv3d-canvas[hidden] { display: none; }

.cv3d-orbit-note {
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 0.35rem 0.62rem;
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 999px;
  background: rgba(3,7,18,0.68);
  color: #aeb8c7;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.cv3d-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.cv3d-empty[hidden] { display: none; }

.cv3d-empty-card {
  width: min(560px, 100%);
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  text-align: center;
}

.cv3d-empty-kicker {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.cv3d-empty-card h3 { margin: 0 0 0.55rem; font-family: var(--font-display); }
.cv3d-empty-card p { margin: 0; color: var(--text-2); line-height: 1.65; }

.cv3d-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.58rem 0.72rem;
  overflow-x: auto;
  border-top: 1px solid rgba(148,163,184,0.12);
  background: rgba(5,9,20,0.76);
  scrollbar-width: thin;
}

[data-theme="light"] .cv3d-toolbar { background: rgba(246,248,252,0.92); }

.cv3d-tool-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cv3d-tool {
  min-height: 34px;
  padding: 0.34rem 0.55rem;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.cv3d-tool.is-active {
  color: var(--accent-2);
  border-color: rgba(47,210,242,0.24);
  background: rgba(47,210,242,0.105);
}

.cv3d-info {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg-elevated) 96%, var(--accent) 4%);
}

.cv3d-info-section + .cv3d-info-section {
  margin-top: 1.05rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--border);
}

.cv3d-info h3 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.cv3d-info h4 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-1);
}

.cv3d-purpose,
.cv3d-info-section p {
  margin: 0.7rem 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
  line-height: 1.65;
}

.cv3d-dims { display: grid; gap: 0.45rem; }
.cv3d-dims > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.48rem 0.55rem;
  border: 1px solid rgba(148,163,184,0.13);
  border-radius: 7px;
  background: rgba(255,255,255,0.025);
}
.cv3d-dims span { color: var(--text-3); font-size: 0.72rem; }
.cv3d-dims b { color: var(--text-1); font-family: var(--font-mono); font-size: 0.72rem; text-align: right; }

.cv3d-part-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cv3d-part-list span {
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 0.7rem;
}

.cv3d-info-note {
  margin-top: 1rem;
  padding: 0.7rem 0.75rem;
  border-left: 2px solid var(--accent-2);
  background: rgba(47,210,242,0.055);
  color: var(--text-3);
  font-size: 0.72rem;
  line-height: 1.55;
}


/* ---------- routed 3D workspace (no modal / no backdrop) ----- */

.learn-explore-3d {
  width: 100%;
  max-width: none;
}

.ex3d-screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.7rem 0 1rem;
}

.ex3d-screen-head .h-page { margin: 0.42rem 0 0.28rem; }
.ex3d-screen-head .sub { margin: 0; }

.cv3d-page-host {
  width: 100%;
  min-width: 0;
  height: clamp(620px, calc(100vh - 205px), 920px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--depth), var(--glass-edge);
}

.cv3d-page-window {
  height: 100%;
}

.cv3d-page-host .cv3d-main {
  height: 100%;
}

.cv3d-page-host .cv3d-viewport {
  min-height: 0;
}

@media (max-width: 860px) {
  .ex3d-screen-head { align-items: flex-start; flex-direction: column; }
  .cv3d-page-host { height: auto; min-height: 0; overflow: visible; }
  .cv3d-page-window { min-height: 760px; }
  .cv3d-page-host .cv3d-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(430px, 1fr) minmax(220px, auto);
  }
  .cv3d-page-host .cv3d-viewport-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .cv3d-page-host .cv3d-info { max-height: none; }
}

/* ---------- info panel ---------------------------------------- */

.cv-info {
  padding: 1.2rem 1.3rem;
  border-top: 1px solid var(--border);
}

.cv-info-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.cv-info-head b { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-1); }

.cv-purpose { font-size: 0.96rem; line-height: 1.65; color: var(--text-2); margin-bottom: 1rem; }

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.cv-grid h5,
.cv-specs h5,
.cv-list h5,
.cv-example h5,
.cv-related h5 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.35rem;
}

.cv-grid p { font-size: 0.9rem; line-height: 1.6; color: var(--text-2); }

.cv-specs { margin-bottom: 1rem; }

.cv-spec {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.cv-spec span { color: var(--text-3); }
.cv-spec b { color: var(--text-1); font-weight: 500; text-align: right; }

.cv-list { margin-bottom: 1rem; }
.cv-list ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.cv-list li, .cv-list p { font-size: 0.88rem; line-height: 1.6; color: var(--text-2); }
.cv-list.warn h5 { color: var(--warning); }
.cv-list.safety h5 { color: var(--danger); }

.cv-example pre {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(3, 6, 16, 0.3);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
}

[data-theme="light"] .cv-example pre { background: rgba(255, 255, 255, 0.6); }

.cv-example { margin-bottom: 1rem; }
.cv-related { margin-bottom: 1rem; }
.cv-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.cv-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-2);
  margin-bottom: 0.8rem;
  cursor: pointer;
}

.cv-back .icon { width: 0.85em; height: 0.85em; transform: rotate(180deg); }
.cv-empty { font-size: 0.88rem; color: var(--text-3); font-style: italic; }

/* ============================================================
   PIN EXPLORER
   ============================================================ */

.pe {
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--depth), var(--glass-edge);
  overflow: hidden;
}

.pe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.pe-k {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
}

.pe-k.power { color: #ff9b9b; background: rgba(255, 123, 123, 0.16); }
.pe-k.gnd { color: #b9c2ce; background: rgba(152, 161, 174, 0.16); }
.pe-k.digital { color: #f5c451; background: rgba(245, 196, 81, 0.16); }
.pe-k.pwm { color: #ffd88a; background: rgba(255, 201, 77, 0.2); }
.pe-k.analog { color: #b7a9ff; background: rgba(157, 140, 255, 0.16); }
.pe-k.serial { color: #7fe0f5; background: rgba(98, 213, 239, 0.16); }

.pe-body { display: grid; grid-template-columns: 1fr 1.2fr; }

.pe-list {
  padding: 0.8rem;
  border-right: 1px solid var(--border);
  display: grid;
  gap: 0.8rem;
  align-content: start;
  max-height: 380px;
  overflow-y: auto;
}

.pe-group h5 {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: 0.4rem;
}

.pe-group { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pe-group h5 { width: 100%; }

.pe-pin {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.pe-pin:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.12); }
.pe-pin.is-sel { color: #fff; background: var(--gradient-brand); box-shadow: 0 4px 12px -6px var(--glow-accent); }
.pe-pin.power { box-shadow: inset 0 0 0 1px rgba(255, 123, 123, 0.4); }
.pe-pin.gnd { box-shadow: inset 0 0 0 1px rgba(152, 161, 174, 0.4); }
.pe-pin.pwm { box-shadow: inset 0 0 0 1px rgba(255, 201, 77, 0.4); }
.pe-pin.analog { box-shadow: inset 0 0 0 1px rgba(157, 140, 255, 0.4); }
.pe-pin.serial { box-shadow: inset 0 0 0 1px rgba(98, 213, 239, 0.4); }

.pe-detail { padding: 1rem 1.1rem; min-height: 200px; }

.pe-d-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.pe-d-head b { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-1); }

/* ============================================================
   RECOGNITION QUIZ
   ============================================================ */

.rq {
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--depth), var(--glass-edge);
  padding: 1rem 1.1rem 1.2rem;
}

.rq-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.rq-q {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.8rem;
}

.rq-stage { background: rgba(3, 6, 16, 0.22); border-radius: var(--radius-md); padding: 0.9rem; }
.rq-svg { width: 100%; height: auto; max-height: 340px; display: block; overflow: visible; }

.rq-target {
  fill: rgba(255, 255, 255, 0.001);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  cursor: pointer;
  transition: fill 0.15s, stroke 0.15s;
}

.rq-target:hover { fill: rgba(47, 210, 242, 0.14); stroke: var(--accent-2); }
.rq-target.hit { fill: rgba(61, 214, 140, 0.3); stroke: var(--success); stroke-dasharray: none; }
.rq-target.miss { fill: rgba(255, 107, 129, 0.28); stroke: var(--danger); stroke-dasharray: none; }

.rq-feedback { margin-top: 0.7rem; font-size: 0.86rem; min-height: 1.2em; color: var(--text-3); }
.rq-feedback.good { color: var(--success); }
.rq-feedback.bad { color: var(--warning); }

/* ============================================================
   CIRCUIT DEMO
   ============================================================ */

.cd {
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  box-shadow: var(--depth), var(--glass-edge);
  overflow: hidden;
}

.cd-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cd-bar b { font-family: var(--font-display); font-size: 0.9rem; color: var(--text-1); }
.cd-faults { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.cd-fault {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.cd-fault:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.1); }
.cd-fault.is-active { color: #fff; background: var(--gradient-brand); }

.cd-stage { padding: 1rem; background: rgba(3, 6, 16, 0.22); }
.cd-svg { width: 100%; height: auto; display: block; }

.cd-svg.is-flowing .cd-wire {
  stroke-dasharray: 10 8;
  animation: cd-flow 0.6s linear infinite;
}

@keyframes cd-flow { to { stroke-dashoffset: -18; } }

.cd-svg.is-danger .cd-wire { stroke: var(--danger) !important; animation: cd-warn 0.4s steps(2) infinite; }
@keyframes cd-warn { 50% { opacity: 0.35; } }

.cd-readout { padding: 0.9rem 1.1rem; }
.cd-steps { display: grid; gap: 0.35rem; margin-bottom: 0.6rem; }

.cd-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
  animation: refresh-item 0.4s var(--ease-out) both;
}

.cd-step .icon { width: 0.85em; height: 0.85em; color: var(--accent-2); }

.cd-note { font-size: 0.88rem; line-height: 1.6; color: var(--text-2); }
.cd-note.good { color: var(--success); }
.cd-note.warn { color: var(--warning); }
.cd-note.bad { color: var(--danger); }

/* ---------- responsive ---------------------------------------- */

@media (max-width: 860px) {
  .cv3d-dialog { width: calc(100vw - 10px); height: calc(100dvh - 10px); border-radius: 13px; }
  .cv3d-main { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) minmax(0, 240px); }
  .cv3d-viewport-wrap { border-right: 0; border-bottom: 1px solid var(--border); }
  .cv3d-viewport { min-height: 340px; }
  .cv3d-info { padding: 0.85rem; }
  .cv3d-status { display: none; }
  .cv3d-views { display: none; }
  .pe-body { grid-template-columns: 1fr; }
  .pe-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 220px; }
  .cv-tools { width: 100%; justify-content: flex-start; }
}


/* ---------- Explore-integrated 3D mode (v40) ------------------ */
.learn-explore.is-3d-mode {
  width: 100%;
  max-width: none;
}

.learn-explore.is-3d-mode .ex-head {
  margin-bottom: 0.75rem;
}

.learn-explore.is-3d-mode #ex-viewer {
  margin-top: 0.25rem;
}

.learn-explore.is-3d-mode #ex-viewer.cv3d-inline-host {
  height: clamp(620px, calc(100vh - 250px), 900px);
  min-height: 620px;
}

.cv3d-inline-host .cv3d-back {
  color: var(--accent-2);
}

.cv3d-inline-host .cv3d-window {
  min-height: 0;
}

@media (max-width: 860px) {
  .learn-explore.is-3d-mode #ex-viewer.cv3d-inline-host {
    height: auto;
    min-height: 0;
  }
  .learn-explore.is-3d-mode .cv3d-page-window { min-height: 760px; }
}
