.qrm-container {
  max-width: 1080px;
}

.qrm-tool {
  align-items: stretch;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
  margin-top: 22px;
  padding: 18px;
}

.qrm-controls,
.qrm-preview-panel {
  border: 1px solid #d8e3ee;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 42, 67, .08);
}

.qrm-controls {
  background: #f8fafc;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.qrm-field {
  display: grid;
  gap: 8px;
}

.qrm-field label,
.qrm-preview-head {
  color: #334155;
  font-weight: 800;
}

#qrm-content,
#qrm-error {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font: inherit;
  width: 100%;
}

#qrm-content {
  line-height: 1.5;
  min-height: 190px;
  padding: 13px 14px;
  resize: vertical;
}

#qrm-error {
  min-height: 44px;
  padding: 9px 10px;
}

.qrm-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qrm-size-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

#qrm-size {
  width: 100%;
}

#qrm-size-value,
#qrm-meta {
  background: #102a43;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  min-width: 88px;
  padding: 5px 10px;
  text-align: center;
}

.qrm-field input[type="color"] {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  height: 44px;
  padding: 5px;
  width: 100%;
}

.qrm-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qrm-actions button {
  font-weight: 800;
}

.qrm-status {
  color: #334155;
  font-weight: 700;
  margin: 0;
  min-height: 26px;
}

.qrm-status.is-error {
  color: #b42318;
}

.qrm-status.is-success {
  color: #0f766e;
}

.qrm-preview-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .1), rgba(245, 158, 11, .1)),
    #fff;
  display: grid;
  gap: 16px;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
}

.qrm-preview-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.qrm-preview-shell {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e3ee;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 340px;
  padding: 18px;
}

.qrm-output {
  align-items: center;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(15, 42, 67, .16);
  display: flex;
  justify-content: center;
  max-width: min(100%, 340px);
  padding: 14px;
  width: 100%;
}

.qrm-output canvas,
.qrm-output img {
  display: block;
  height: auto !important;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  max-height: 100%;
  max-width: 100%;
  width: auto !important;
}

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

  .qrm-preview-shell {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .qrm-tool {
    padding: 12px;
  }

  .qrm-grid,
  .qrm-actions {
    grid-template-columns: 1fr;
  }

  .qrm-preview-head,
  .qrm-size-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .qrm-preview-head {
    flex-direction: column;
  }

  #qrm-size-value,
  #qrm-meta {
    width: 100%;
  }
}
