.qr-lesson-card {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10000;
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 0.9rem;
  background: #111;
  color: #f5f5f5;
  box-shadow: 0 0.85rem 2.8rem rgb(0 0 0 / 0.42);
}

.qr-lesson-label {
  margin: 0 0 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.qr-lesson-card h2 {
  margin: 0 0 0.45rem;
  color: inherit;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  line-height: 1.2;
}

.qr-lesson-card p:not(.qr-lesson-label) {
  margin: 0 0 0.85rem;
  color: rgb(255 255 255 / 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.qr-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.qr-lesson-button {
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  border: 0;
  border-radius: 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.qr-lesson-button:hover,
.qr-lesson-stop:hover {
  filter: brightness(1.08);
}

.qr-lesson-button:active,
.qr-lesson-stop:active {
  transform: translateY(1px);
}

.qr-lesson-button:focus-visible,
.qr-lesson-stop:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.qr-lesson-yes {
  background: #29c967;
  color: #06150b;
}

.qr-lesson-no {
  background: #333;
  color: #fff;
}

.qr-lesson-stop {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 2px solid rgb(255 255 255 / 0.9);
  border-radius: 999px;
  background: #d63c45;
  color: #fff;
  box-shadow: 0 0.55rem 1.8rem rgb(0 0 0 / 0.45);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.qr-lesson-stop[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .qr-lesson-card {
    right: max(0.65rem, env(safe-area-inset-right));
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    left: max(0.65rem, env(safe-area-inset-left));
    width: auto;
    max-height: min(50vh, 24rem);
    padding: 0.9rem;
  }

  .qr-lesson-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-lesson-button,
  .qr-lesson-stop {
    transition: none;
  }
}
