.qr-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}

.qr-tabs button {
  border: 1px solid #d9dde5;
  background: #f7f8fb;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.qr-tabs button[aria-selected='true'] {
  background: #0b57d0;
  color: #fff;
  border-color: #0b57d0;
}

.qr-shell {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.qr-panel {
  background: #fff;
  border: 1px solid #e3e6ee;
  border-radius: 14px;
  padding: 16px;
}

.qr-panel h3 {
  margin-top: 0;
}

.qr-type-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-bottom: 12px;
}

.qr-type-grid button {
  border: 1px solid #d9dde5;
  background: #f9fafc;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.qr-type-grid button.active {
  border-color: #0b57d0;
  box-shadow: inset 0 0 0 1px #0b57d0;
  background: #eef4ff;
}

.qr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.qr-field input,
.qr-field textarea,
.qr-field select {
  border: 1px solid #d9dde5;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.qr-field textarea {
  min-height: 110px;
  resize: vertical;
}

.qr-inline {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.qr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.qr-actions .primary {
  background: #0b57d0;
  color: #fff;
  border: 1px solid #0b57d0;
}

.qr-actions button {
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid #d9dde5;
  background: #f7f8fb;
  cursor: pointer;
  font-weight: 600;
}

.qr-preview {
  display: grid;
  place-items: center;
  background: #f7f8fb;
  border-radius: 12px;
  padding: 12px;
  min-height: 240px;
}

.qr-preview canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.qr-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.qr-status[data-state='ok'] {
  color: #0b7a46;
}

.qr-status[data-state='warn'] {
  color: #b45309;
}

.qr-status[data-state='block'] {
  color: #b91c1c;
}

.qr-quality {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.qr-quality-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e3e6ee;
  background: #fff;
  font-size: 0.92rem;
}

.qr-quality-item strong {
  min-width: 90px;
}

.qr-quality-item[data-state='ok'] {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.qr-quality-item[data-state='warn'] {
  border-color: #fde68a;
  background: #fffbeb;
}

.qr-quality-item[data-state='block'] {
  border-color: #fecaca;
  background: #fef2f2;
}

.qr-meta {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: #4b5563;
}

.qr-export-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.qr-export-grid button {
  width: 100%;
}

.qr-steps {
  padding-left: 18px;
  margin: 0 0 12px;
}

.qr-tabs-panel[hidden] {
  display: none;
}

.qr-scan-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.qr-video-wrap {
  position: relative;
  overflow: hidden;
}

.qr-video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e3e6ee;
  background: #000;
}

.qr-scan-frame {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.qr-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.qr-color-presets button {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid #d9dde5;
  background: #f7f8fb;
  cursor: pointer;
  font-weight: 600;
}

.qr-result-card {
  border: 1px solid #e3e6ee;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.qr-result-card pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #f7f8fb;
  padding: 10px;
  border-radius: 8px;
}

.qr-share-note {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 6px;
}

.qr-embed .qr-tabs,
.qr-embed .qr-learn,
.qr-embed .qr-secondary,
.qr-embed .ad-slot,
.qr-embed #comments {
  display: none;
}

.qr-embed .qr-preview {
  min-height: 320px;
}

@media (max-width: 720px) {
  .qr-actions,
  .qr-export-grid {
    flex-direction: column;
  }
}
