.lesson-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #0b1020;
}

.v3d-container {
  touch-action: none;
}

.lesson-card {
  pointer-events: auto;
  position: absolute;
  top: 72px;
  right: 8px;
  width: min(380px, calc(100vw - 16px));
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  user-select: none;
}

.lesson-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  cursor: grab;
  touch-action: none;
}

.lesson-card-header:active {
  cursor: grabbing;
}

.lesson-card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.lesson-card-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.lesson-row-wrap {
  flex-wrap: wrap;
}

.lesson-spacer {
  flex: 1;
}

.lesson-chip-label {
  font-size: 13px;
  font-weight: 800;
  color: rgba(17, 24, 39, 0.78);
  padding: 0 6px;
}

.lesson-card-prompt {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-btn {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: #0b1020;
  border-radius: 999px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.lesson-btn-toggle {
  background: rgba(255, 255, 255, 0.88);
}

.lesson-btn-toggle.is-active {
  border-color: rgba(47, 107, 255, 0.28);
  background: rgba(47, 107, 255, 0.10);
  color: rgba(28, 55, 160, 1);
}

.lesson-btn:hover:enabled {
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.lesson-btn:active:enabled {
  transform: translateY(1px);
}

.lesson-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lesson-btn-primary {
  border-color: rgba(47, 107, 255, 0.25);
  background: rgba(47, 107, 255, 0.92);
  color: #ffffff;
}

.lesson-btn-primary:hover:enabled {
  background: rgba(47, 107, 255, 1);
}

.lesson-btn-ghost {
  background: rgba(255, 255, 255, 0.72);
}

.lesson-btn-icon {
  width: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.lesson-btn-small {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.lesson-btn-large {
  height: 46px;
  font-size: 15px;
}

.lesson-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lesson-btn-option {
  text-align: center;
}

.lesson-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lesson-row .lesson-btn {
  flex: 1;
}

.lesson-debug-row .lesson-btn {
  flex: 0 0 auto;
}


.lesson-card-log {
  width: 100%;
  min-height: 84px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.92);
  color: #111827;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.lesson-card.is-collapsed .lesson-card-body {
  display: none;
}

@media (max-width: 600px) {
  .lesson-card {
    left: 6px;
    right: 6px;
    top: auto;
    bottom: 6px;
    width: auto;
  }

  .lesson-card-prompt {
    font-size: 16px;
    font-weight: 800;
  }
}
