/* QRコード3Dタグメーカー */

.qr3d-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 20px 0 30px;
}

.qr3d-controls {
  flex: 1;
  min-width: 300px;
}

.qr3d-previews {
  flex: 1;
  min-width: 300px;
  position: sticky;
  top: 20px;
}

.qr3d-section {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.qr3d-section h2 {
  /* common.cssのレガシー `h2 { width: 900px }` を打ち消す */
  width: auto;
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: #1e293b;
}

.qr3d-field {
  margin-bottom: 14px;
}

.qr3d-field:last-child {
  margin-bottom: 0;
}

.qr3d-field > label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.qr3d-field textarea,
.qr3d-field input[type="text"],
.qr3d-field select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
}

.qr3d-field textarea {
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
}

.qr3d-radio-group {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.qr3d-radio-group label,
.qr3d-check label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

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

.qr3d-range-row input[type="range"] {
  flex: 1;
}

.qr3d-range-row .qr3d-range-value {
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  font-weight: bold;
}

.qr3d-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.qr3d-check {
  margin-bottom: 10px;
}

.qr3d-preview-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.qr3d-preview-panel h3 {
  font-size: 0.95rem;
  color: #475569;
  margin: 0 0 10px;
  text-align: left;
}

.qr3d-preview-panel canvas {
  max-width: 100%;
  height: auto;
}

#qr3dScanCanvas {
  width: min(240px, 100%);
  image-rendering: pixelated;
  border: 1px solid #e2e8f0;
}

.qr3d-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  font-size: 13px;
  color: #475569;
  margin-top: 10px;
}

.qr3d-warning {
  display: none;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 12px;
  text-align: left;
}

.qr3d-error {
  display: none;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
  text-align: left;
}

.qr3d-download {
  text-align: center;
  margin-top: 4px;
}

.qr3d-download button {
  background: var(--accent, #2a9d8f);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 13px 34px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.qr3d-download button:hover:not(:disabled) {
  background: var(--accent-hover, #21867a);
}

.qr3d-download button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.qr3d-filename {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
  font-family: monospace;
}

.qr3d-colors-note {
  display: flex;
  gap: 14px;
  justify-content: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
}

.qr3d-colors-note .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.qr3d-colors-note .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
}

@media (max-width: 768px) {
  .qr3d-layout {
    flex-direction: column;
  }

  .qr3d-previews {
    position: static;
    width: 100%;
  }
}
