/* Only what the QR tool needs on top of tool_page.css: the input side, the
   option toggles and the preview panel. */
.qr-tool {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

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

.qr-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border-radius: 24px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 2, 18, 0.6);
}

.qr-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.qr-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
}

.qr-input {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  resize: vertical;
}

.qr-input {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.qr-input::-webkit-scrollbar {
  width: 8px;
}

.qr-input::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
}

.qr-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.qr-input:focus {
  outline: none;
  border-color: #6e00ff;
}

.qr-count {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.qr-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qr-option {
  padding: 8px 16px;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.qr-option:hover {
  color: #fff;
}

.qr-option.is-active {
  background: #6e00ff;
  border-color: #6e00ff;
  color: #fff;
}

.qr-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.qr-color {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.qr-color input {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
}

.qr-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-tool.is-empty .qr-preview {
  background: rgba(255, 255, 255, 0.04);
}

.qr-placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  text-align: center;
}

.qr-tool:not(.is-empty) .qr-placeholder {
  display: none;
}

.qr-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
}

.qr-status.is-error {
  color: #ff8f8f;
}

.qr-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.qr-downloads .tp-btn {
  /* Sized by their own label, so a long one wraps the whole button onto the
     next row instead of wrapping the words inside it. The tighter side padding
     is what keeps the English pair ("Download PNG" / "Download SVG") on one
     row in the narrow preview column. */
  flex: 1 1 auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (max-width: 900px) {
  .qr-tool {
    grid-template-columns: 1fr;
  }

  .qr-preview {
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }
}
