body.qr-3d-page {
  background: #f6f7f8;
}

/* .page, .tool-header, .tool-subtitle live in base.css (shared shell) */

/* --- Tool card -------------------------------------------------------- */

.qr-app {
  max-width: 460px;
  margin: 0 auto 2rem;
  padding: 1rem 1rem 1.25rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (min-width: 640px) {
  .qr-app {
    max-width: 640px;
    padding: 1.75rem 1.75rem 2rem;
  }
}

.qr-app label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.field {
  margin-bottom: 0.75rem;
}

#url-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  min-height: 44px;
}

#url-input::placeholder {
  color: #595959;
}

#url-input:focus-visible {
  border-color: #2563eb;
}

.privacy-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a5f;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* --- Options: secondary, visually subordinate to input/result. Placed
   after the result so the primary input → output path stays short. ---- */

.controls-heading {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5563;
}

.piece-controls {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e5e5;
}

.control-group {
  margin-bottom: 1rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

@media (min-width: 480px) {
  .piece-controls {
    display: flex;
    gap: 1.5rem;
  }

  .control-group {
    flex: 1;
    margin-bottom: 0;
  }
}

#shape-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  min-height: 44px;
}

#size-input {
  width: 100%;
  height: 44px;
}

#size-value {
  font-variant-numeric: tabular-nums;
}

/* --- Result: QR 2D + 3D preview, always visible together, never in
   separate tabs. Side by side once there's room; stacked and directly
   adjacent (nothing sandwiched between them) on narrow viewports. -------- */

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.result-heading {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  text-align: center;
}

@media (min-width: 640px) {
  .result-heading {
    font-size: 0.95rem;
    text-align: left;
  }
}

.qr-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  max-width: 230px;
  margin: 0 auto;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}

@media (min-width: 640px) {
  .qr-stage {
    max-width: none;
  }
}

.qr-canvas-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-empty-state {
  color: #555555;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
  margin: 0;
}

.qr-info {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  color: #555555;
  font-variant-numeric: tabular-nums;
}

.viewer-container {
  position: relative;
  width: 100%;
  max-width: 230px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}

@media (min-width: 640px) {
  .viewer-container {
    max-width: none;
  }
}

.viewer-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-status {
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: #555555;
  font-size: 0.85rem;
  background: #fafafa;
}

/* [hidden] and this class have equal CSS specificity, and an unconditional
   `display: flex` here used to beat the browser's `[hidden] { display: none
   }` UA rule -- the status text would go empty but this absolutely
   positioned, opaque-background box stayed on screen, fully covering the
   canvas underneath. Scoping display to :not([hidden]) lets the browser's
   own hidden handling win when JS sets statusEl.hidden = true. */
.viewer-status:not([hidden]) {
  display: flex;
}

.viewer-hint {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: #555555;
}

/* --- Measurements: plain text data, always visible, never only in the
   3D view -------------------------------------------------------------- */

.geometry-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}

.geometry-list {
  margin: 0;
}

.geometry-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  padding: 0.3rem 0;
}

.geometry-row dt {
  color: #555555;
}

.geometry-row dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.printability-warning {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid #dc2626;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* --- Export ------------------------------------------------------------ */

.export-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}

.export-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.export-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #15803d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.export-button:hover {
  background: #12692f;
}

.export-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.export-status {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: #555555;
}

/* --- Explainer + FAQ: static, indexable without JS -------------------- */

.explainer,
.faq {
  max-width: 640px;
  margin: 0 auto 2rem;
  padding: 0 0.25rem;
}

.explainer h2,
.faq h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.explainer ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: #374151;
  line-height: 1.6;
}

.explainer p {
  color: #374151;
  line-height: 1.6;
}

.faq details {
  border-bottom: 1px solid #e5e5e5;
}

.faq summary {
  padding: 0.9rem 0.25rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  color: #4b5563;
}

.faq details p {
  margin: 0 0.25rem 1rem;
  color: #374151;
  line-height: 1.6;
}
