/* NeverQR. The signature element: the live code preview, a printed sticker on a ruled sheet (nqr-canvas). */

.nqr-designer {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 960px) {
  .nqr-designer {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .nqr-preview {
    position: sticky;
    top: 5rem;
  }
}
.nqr-canvas {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in oklab, var(--border) 70%, transparent) 23px 24px),
    var(--muted);
  min-height: 260px;
}
.nqr-canvas svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 1px 0 color-mix(in oklab, var(--foreground) 12%, transparent));
}
.nqr-thumb svg {
  width: 56px;
  height: 56px;
  display: block;
}
.nqr-label {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.nqr-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.5rem;
  border: 0;
  padding: 0;
  margin: 0;
}
.nqr-type {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  background: var(--card);
}
.nqr-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nqr-type svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.nqr-type:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  color: var(--primary);
}
.nqr-type:has(input:focus-visible) {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.nqr-type.static {
  border-style: dashed;
}

/* Only the chosen type's fields show (without :has support, every block shows and the server ignores the rest). */
@supports selector(:has(*)) {
  .nqr-content .t-block {
    display: none;
  }
  .nqr-designer:has(input[name="type"][value="url"]:checked) .t-url,
  .nqr-designer:has(input[name="type"][value="app"]:checked) .t-app,
  .nqr-designer:has(input[name="type"][value="vcard"]:checked) .t-vcard,
  .nqr-designer:has(input[name="type"][value="links"]:checked) .t-links,
  .nqr-designer:has(input[name="type"][value="file"]:checked) .t-file,
  .nqr-designer:has(input[name="type"][value="event"]:checked) .t-event,
  .nqr-designer:has(input[name="type"][value="wifi"]:checked) .t-wifi,
  .nqr-designer:has(input[name="type"][value="text"]:checked) .t-text,
  .nqr-designer:has(input[name="type"][value="email"]:checked) .t-email,
  .nqr-designer:has(input[name="type"][value="sms"]:checked) .t-sms,
  .nqr-designer:has(input[name="type"][value="phone"]:checked) .t-phone,
  .nqr-designer:has(input[name="type"][value="geo"]:checked) .t-geo {
    display: grid;
    gap: 0.75rem;
  }
  .nqr-typehint .t-hint-static {
    display: none;
  }
  .nqr-designer:has(.nqr-type.static input:checked) .t-hint-static {
    display: inline;
  }
  .nqr-designer:has(.nqr-type.static input:checked) .t-hint-dynamic {
    display: none;
  }
}
.nqr-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.nqr-panel {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.nqr-panel > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.nqr-panel > summary svg {
  width: 1rem;
  height: 1rem;
}
.nqr-color input[type="color"] {
  width: 100%;
  height: 2.25rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
}
.nqr-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.nqr-swatches {
  display: inline-flex;
  gap: 4px;
}
.nqr-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.qr-warn {
  font-size: 0.875rem;
  margin: 0.25rem 0;
}
.qr-warn.error {
  color: var(--destructive);
}
.nqr-scanbox {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem 1rem;
}
.nqr-dest {
  font-size: 1.5rem;
  font-weight: 700;
}
.nqr-hosted h1 {
  margin-bottom: 0;
}
.nqr-short {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
}
.nqr-bars {
  display: grid;
  gap: 0.35rem;
}
.nqr-bar {
  display: grid;
  grid-template-columns: 7.5rem 1fr 3rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}
.nqr-bar > i {
  display: block;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  min-width: 2px;
}
.nqr-hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  align-items: end;
  height: 72px;
}
.nqr-hours i {
  display: block;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
}
.nqr-compare td,
.nqr-compare th {
  text-align: center;
}
.nqr-compare td:first-child,
.nqr-compare th:first-child {
  text-align: left;
}
.nqr-yes {
  color: var(--success, #15803d);
  font-weight: 700;
}
.nqr-no {
  color: var(--destructive);
  font-weight: 700;
}
.nqr-hero-code svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}
