/* quadrilateral-explorer.css — Quadrilateral Explorer (qe-) */

.qe-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--sm-canvas-bg);
}

.qe-canvas-wrap {
  flex: 1;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  transition: box-shadow var(--sm-transition, 0.2s ease);
}

.qe-canvas-wrap.qe-canvas-wrap--locked {
  box-shadow:
    inset 0 0 0 2px var(--sm-highlight),
    0 0 0 1px var(--sm-highlight-bg);
}

.qe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: default;
}

.qe-panel {
  flex-shrink: 0;
  max-height: 38vh;
  overflow-y: auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--sm-border);
  background: var(--sm-surface);
}

.qe-panel.qe-panel--collapsed {
  max-height: none;
  overflow: visible;
  padding-top: 8px;
  padding-bottom: 8px;
  /* Above floating toolbar (900) and help trigger (200); below app header (1000). */
  position: relative;
  z-index: 950;
}

.qe-panel.qe-panel--collapsed .qe-panel-body {
  display: none !important;
}

.qe-panel-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
}

.qe-panel.qe-panel--collapsed .qe-panel-head {
  margin-bottom: 0;
}

.qe-panel-collapse {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--sm-border);
  border-radius: 8px;
  background: var(--sm-surface);
  color: var(--sm-text-muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.qe-panel-collapse:hover {
  background: var(--sm-surface-raised);
  border-color: var(--sm-indigo);
  color: var(--sm-text);
}

.qe-panel-collapse:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}

.qe-panel-collapse-icon {
  display: block;
  transform-origin: 50% 50%;
  transition: transform var(--sm-transition, 0.2s ease);
}
.qe-panel-collapse-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qe-panel-body {
  min-height: 0;
}

.qe-shape-name {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 12px;
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--sm-indigo);
  background: var(--sm-indigo-light);
  border-radius: 8px;
  border: 1px solid var(--sm-border);
  max-width: 100%;
  box-sizing: border-box;
  transition:
    color var(--sm-transition, 0.2s ease),
    background var(--sm-transition, 0.2s ease),
    border-color var(--sm-transition, 0.2s ease),
    opacity var(--sm-transition, 0.2s ease);
}

.qe-shape-name.qe-shape-name--tree {
  flex-direction: column;
  align-items: stretch;
}

.qe-shape-name-text--hidden {
  display: none !important;
}

.qe-shape-name-text.qe-shape-name-text--hierarchy-strip {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

/* Phase 5: inclusive hierarchy tree */
.qe-hierarchy {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.qe-hierarchy--hidden {
  display: none !important;
}

.qe-hierarchy-root {
  text-align: center;
  margin-bottom: 2px;
}

.qe-hierarchy-join {
  width: 1px;
  height: 8px;
  margin: 0 auto 2px;
  background: var(--sm-border);
}

.qe-hierarchy-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  align-items: start;
}

.qe-hierarchy-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.qe-tree-step {
  display: flex;
  justify-content: center;
  width: 100%;
}

.qe-tree-rect-rhomb {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 6px;
  width: 100%;
}

.qe-tree-step--square {
  margin-top: 1px;
}

.qe-tree-node {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--sm-border);
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  transition:
    color var(--sm-transition, 0.2s ease),
    background var(--sm-transition, 0.2s ease),
    border-color var(--sm-transition, 0.2s ease),
    opacity var(--sm-transition, 0.2s ease);
}

.qe-tree-node--active {
  color: var(--sm-indigo);
  background: var(--sm-indigo-light);
  border-color: var(--sm-indigo);
  opacity: 1;
}

.qe-tree-node--inactive {
  color: var(--sm-text-muted);
  background: var(--sm-bg);
  border-color: var(--sm-border);
  opacity: 0.35;
}

.qe-shape-name.qe-shape-name--hidden {
  color: var(--sm-text-muted);
  background: var(--sm-highlight-bg);
  border-color: var(--sm-highlight);
}

.qe-shape-name.qe-shape-name--complex {
  color: var(--sm-incorrect);
  background: var(--sm-incorrect-bg);
  border-color: var(--sm-incorrect);
}

.qe-measurements {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sm-text);
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--sm-border);
  background: var(--sm-bg);
  box-sizing: border-box;
}

.qe-measurements.qe-measurements--hidden {
  display: none;
}

.qe-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qe-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--sm-text-muted);
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--sm-bg);
  border: 1px solid var(--sm-border);
  min-height: var(--sm-touch-min, 44px);
  box-sizing: border-box;
  transition:
    color var(--sm-transition, 0.2s ease),
    background var(--sm-transition, 0.2s ease),
    border-color var(--sm-transition, 0.2s ease);
}

@media (min-width: 641px) {
  .qe-checklist li {
    min-height: auto;
    padding: 4px 8px;
  }
}

@media (min-width: 900px) {
  .qe-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: start;
  }
}

.qe-checklist li.qe-check--on {
  color: var(--sm-text);
  border-color: var(--sm-correct);
  background: var(--sm-correct-bg);
}

.qe-checklist li.qe-check--na {
  opacity: 0.45;
  font-style: italic;
}

.qe-checklist .qe-check-glyph {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1.5px solid var(--sm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-top: 1px;
}

.qe-checklist li.qe-check--on .qe-check-glyph {
  border-color: var(--sm-correct);
  background: var(--sm-surface);
  color: var(--sm-correct);
}

.qe-checklist .qe-check-label {
  flex: 1;
}

.qe-checklist .qe-check-label .katex {
  font-size: 1em;
}

/* Right sidebar for properties panel — grid layout overrides */
.sm-layout.qe-has-right-panel {
  grid-template-columns: var(--sm-sidebar-width, 260px) 1fr 260px;
}
.sm-layout.qe-has-right-panel.collapsed {
  grid-template-columns: 0px 1fr 260px;
}
.sm-layout.qe-has-right-panel.qe-right-panel-collapsed {
  grid-template-columns: var(--sm-sidebar-width, 260px) 1fr 56px;
}
.sm-layout.qe-has-right-panel.collapsed.qe-right-panel-collapsed {
  grid-template-columns: 0px 1fr 56px;
}
.qe-right-sidebar {
  position: relative;
  overflow-y: auto;
  background: var(--sm-surface);
  min-height: 0;
}
/* Top band: match .sm-help-btn (top: sm-top-offset + 8px); collapse is 44px tall */
@media (min-width: 641px) {
  .qe-right-sidebar {
    padding-top: calc(8px + 44px + 10px);
    box-sizing: border-box;
  }
  .qe-right-sidebar .qe-panel--right:not(.qe-panel--collapsed) .qe-panel-collapse {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 220;
  }
}
@media (max-width: 640px) {
  .sm-layout.qe-has-right-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .sm-layout.qe-has-right-panel.collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: 0px 1fr auto;
  }
  .sm-layout.qe-has-right-panel.qe-right-panel-collapsed .qe-right-sidebar {
    max-height: 88px;
  }
  .qe-right-sidebar {
    max-height: 35vh;
  }
}

/* Panel position: right */
.qe-panel.qe-panel--right {
  border-top: none;
  max-height: none;
  padding: 12px 12px 14px;
}

.qe-panel--right .qe-panel-head {
  flex-direction: row;
  align-items: stretch;
}

/* Narrow / stacked layout: keep collapse in-flow on the left of the name row */
@media (max-width: 640px) {
  .qe-panel--right .qe-panel-head {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }
}

/* Right dock: collapse narrows the whole column to an edge strip (not “up” only). */
.qe-panel.qe-panel--right.qe-panel--collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  box-sizing: border-box;
}
.qe-right-sidebar .qe-panel--right.qe-panel--collapsed .qe-panel-collapse {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
}
.qe-panel.qe-panel--right.qe-panel--collapsed .qe-panel-head {
  flex-direction: column;
  margin: 0;
  gap: 0;
  width: 100%;
  align-items: center;
}
.qe-panel.qe-panel--right.qe-panel--collapsed .qe-shape-name {
  display: none !important;
}

.qe-panel--right .qe-shape-name {
  flex: none;
  width: 100%;
  max-width: 100%;
  font-size: 15px;
}

@media (max-width: 640px) {
  .qe-panel--right .qe-shape-name {
    flex: 1;
    min-width: 0;
    width: auto;
  }
}

.qe-panel--right .qe-hierarchy {
  font-size: 10px;
}

.qe-panel--right .qe-tree-node {
  padding: 2px 5px;
}
.qe-panel--right .qe-measurements {
  font-size: 12px;
  padding: 6px 8px;
  margin-bottom: 8px;
}
.qe-panel--right .qe-checklist {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.qe-panel--right .qe-checklist li {
  min-height: auto;
  padding: 4px 6px;
  font-size: 12px;
}
.qe-panel--right .qe-check-glyph {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

/* Panel position: top */
.qe-panel.qe-panel--top {
  border-top: none;
  border-bottom: 1px solid var(--sm-border);
}

/* Stack panel-position button group vertically */
#qe-ctl-panel-pos .sm-btn-group {
  flex-direction: column;
  border-radius: 6px;
}
#qe-ctl-panel-pos .sm-btn-group-item {
  border-right: none;
  white-space: normal;
  text-align: center;
  justify-content: center;
}
#qe-ctl-panel-pos .sm-btn-group-item:not(:last-child) {
  border-right: none;
  border-bottom: 1px solid var(--sm-border);
}

/* Phase 6a: Advanced collapsible sidebar section */
.qe-advanced-heading {
  margin: 0;
  width: 100%;
  min-width: 0;
}

.qe-advanced-heading .qe-advanced-trigger {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--sm-touch-min, 44px);
  margin: 0;
  padding: 0 2px 0 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sm-text-muted);
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qe-advanced-heading .qe-advanced-trigger:hover {
  color: var(--sm-text);
}

.qe-advanced-heading .qe-advanced-trigger:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}

.qe-advanced-heading .qe-advanced-trigger::after {
  content: '';
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
  transition: transform var(--sm-transition, 0.2s ease);
  transform: rotate(-90deg);
}

.qe-advanced-heading--open .qe-advanced-trigger::after {
  transform: rotate(0deg);
}

.qe-advanced-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Author `display: flex` must not beat `[hidden]` (collapse broke in some engines). */
.qe-advanced-section[hidden] {
  display: none !important;
}

/* Zoom controls overlay */
/* Floating inclusive hierarchy (over canvas) */
.qe-hierarchy-float {
  position: absolute;
  z-index: 20;
  box-sizing: border-box;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: 10px;
  box-shadow: 0 4px 14px var(--sm-border);
  overflow: visible;
  padding: 0;
  touch-action: none;
}

.qe-hierarchy-float--hidden {
  display: none !important;
}

.qe-hierarchy-float--measuring {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.qe-hfloat-header {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--sm-border);
  background: var(--sm-bg);
}

.qe-hfloat-drag {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  border-radius: 0;
  border-bottom: none;
  background: transparent;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qe-hfloat-close {
  flex-shrink: 0;
  width: 44px;
  min-width: 44px;
  min-height: var(--sm-touch-min, 44px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--sm-text-muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition:
    color var(--sm-transition, 0.2s ease),
    background var(--sm-transition, 0.2s ease);
}

.qe-hfloat-close:hover {
  color: var(--sm-text);
  background: var(--sm-surface-raised);
}

.qe-hfloat-close:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: -2px;
}

.qe-hfloat-drag::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    var(--sm-border) 0 3px,
    transparent 3px 6px
  );
  opacity: 0.85;
}

.qe-hfloat-body {
  position: relative;
  overflow: hidden;
  margin: 0;
  flex-shrink: 0;
}

.qe-hfloat-scale-wrap {
  transform-origin: 0 0;
  will-change: transform;
}

.qe-hfloat-scale-wrap .qe-hierarchy {
  width: auto;
  max-width: none;
}

/* Floating hierarchy: use the panel footprint, centre content, larger pills */
.qe-hierarchy-float .qe-hfloat-scale-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qe-hierarchy-float .qe-hierarchy {
  font-size: 16px;
  line-height: 1.3;
  /* Slightly tighter inset on the right (kite branch) only */
  padding: 8px 6px 8px 12px;
  box-sizing: border-box;
}

.qe-hierarchy-float .qe-hierarchy-root {
  margin-bottom: 4px;
}

.qe-hierarchy-float .qe-hierarchy-join {
  height: 10px;
  margin-bottom: 4px;
}

.qe-hierarchy-float .qe-hierarchy-split {
  grid-template-columns: max-content max-content;
  gap: 10px 14px;
}

.qe-hierarchy-float .qe-hierarchy-col {
  gap: 7px;
}

.qe-hierarchy-float .qe-tree-step {
  width: auto;
}

.qe-hierarchy-float .qe-tree-rect-rhomb {
  width: auto;
  gap: 7px 9px;
}

.qe-hierarchy-float .qe-tree-node {
  padding: 6px 14px;
  border-radius: 8px;
}

.qe-hfloat-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  cursor: nwse-resize;
  border-radius: 0 0 10px 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 40%,
    var(--sm-border) 40%,
    var(--sm-border) 45%,
    transparent 45%,
    transparent 55%,
    var(--sm-border) 55%,
    var(--sm-border) 60%,
    transparent 60%
  );
}

.qe-hfloat-resize:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 1px;
}

.qe-zoom-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}
.qe-zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--sm-border);
  background: var(--sm-surface);
  color: var(--sm-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.qe-zoom-btn:hover {
  background: var(--sm-surface-raised);
  border-color: var(--sm-indigo);
}
.qe-zoom-btn:active {
  background: var(--sm-indigo-light);
}
.qe-zoom-btn:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}

.qe-zoom-sep {
  width: 24px;
  height: 0;
  border-top: 1px solid var(--sm-border);
  margin: 2px auto;
}

/* Stack naming-mode button group vertically in sidebar */
#qe-ctl-naming .sm-btn-group {
  flex-direction: column;
  border-radius: 6px;
}
#qe-ctl-naming .sm-btn-group-item {
  border-right: none;
  white-space: normal;
  text-align: center;
  justify-content: center;
}
#qe-ctl-naming .sm-btn-group-item:not(:last-child) {
  border-right: none;
  border-bottom: 1px solid var(--sm-border);
}

/* Reveal toggle sits after naming — keep readable on narrow sidebar */
#qe-ctl-reveal-name .sm-toggle-label {
  line-height: 1.25;
}

/* Lock shape — native select, compact sidebar */
.qe-lock-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--sm-touch-min, 44px);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--sm-text);
  background: var(--sm-surface);
  border: 1.5px solid var(--sm-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.qe-lock-select:hover {
  border-color: var(--sm-indigo);
}
.qe-lock-select:focus {
  outline: none;
  border-color: var(--sm-indigo);
  box-shadow: 0 0 0 2px var(--sm-indigo-light);
}
.qe-lock-select:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}
.sm-control.disabled .qe-lock-select {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Challenge mode (guided tasks) */
.qe-challenge-wrap--hidden {
  display: none;
}

.qe-checklist.qe-checklist--hidden {
  display: none !important;
}

.qe-challenge-pick {
  margin: 0 0 12px;
}

.qe-challenge-pick-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--sm-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.qe-challenge-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: var(--sm-touch-min, 44px);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--sm-text);
  background: var(--sm-surface);
  border: 1.5px solid var(--sm-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qe-challenge-select:hover {
  border-color: var(--sm-indigo);
}

.qe-challenge-select:focus {
  outline: none;
  border-color: var(--sm-indigo);
  box-shadow: 0 0 0 2px var(--sm-indigo-light);
}

.qe-challenge-select:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}

.qe-challenge-select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.qe-challenge-card {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--sm-border);
  background: var(--sm-bg);
  transition:
    border-color var(--sm-transition, 0.2s ease),
    background var(--sm-transition, 0.2s ease),
    box-shadow var(--sm-transition, 0.2s ease);
}

.qe-challenge-card.qe-challenge-card--success {
  border-color: var(--sm-correct);
  background: var(--sm-correct-bg);
  box-shadow: 0 0 0 1px var(--sm-correct);
}

.qe-challenge-card.qe-challenge-card--complete {
  border-color: var(--sm-indigo);
  background: var(--sm-indigo-light);
}

.qe-challenge-prompt {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--sm-text);
}

.qe-challenge-card--complete .qe-challenge-prompt {
  margin-bottom: 0;
}

.qe-challenge-feedback {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--sm-correct);
}

.qe-challenge-feedback--hidden {
  display: none;
}

.qe-challenge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.qe-challenge-btn {
  min-height: var(--sm-touch-min, 44px);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--sm-text);
  background: var(--sm-surface);
  border: 1.5px solid var(--sm-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.qe-challenge-btn:hover {
  background: var(--sm-surface-raised);
  border-color: var(--sm-indigo);
}

.qe-challenge-btn:focus-visible {
  outline: 2px solid var(--sm-indigo);
  outline-offset: 2px;
}

.qe-challenge-btn--primary {
  color: var(--sm-indigo);
  border-color: var(--sm-indigo);
  background: var(--sm-indigo-light);
}

.qe-challenge-btn--hidden,
.qe-challenge-next--hidden,
.qe-challenge-restart--hidden {
  display: none;
}

.qe-challenge-progress {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--sm-text-muted);
}

.qe-panel--right .qe-challenge-pick-label {
  font-size: 11px;
}
.qe-panel--right .qe-challenge-select {
  min-height: 40px;
  font-size: 12px;
  padding: 6px 8px;
}
.qe-panel--right .qe-challenge-prompt {
  font-size: 13px;
}
.qe-panel--right .qe-challenge-btn {
  min-height: 40px;
  font-size: 13px;
  padding: 6px 12px;
}
