/* QR Maker — same chrome as invoice builder (app-body / panels / preview) */

.qr-preview-wrap {
  width: min(420px, 100%);
  margin: 0 auto;
}

.qr-sheet {
  background: #fff;
  color: #171719;
  border: 1px solid #d9d8d3;
  box-shadow: 0 22px 70px rgb(0 0 0 / 18%);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 520px;
}

.qr-sheet-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #171719;
  direction: ltr;
}

.qr-sheet-mark {
  order: 1;
  margin-right: auto;
  text-align: left;
  direction: rtl;
}

.qr-sheet-kicker {
  display: block;
  color: #e45d1a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.qr-sheet-mark strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.qr-sheet-meta {
  order: 2;
  color: #85858a;
  font-size: 12px;
  font-weight: 700;
  direction: rtl;
}

.qr-sheet-body {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 8px 0;
}

.qr-canvas-frame {
  width: min(100%, 320px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  border: 0.3mm solid #c8c8c8;
  padding: 18px;
}

.qr-host {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

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

.qr-empty {
  margin: 0;
  color: #6b6b6b;
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
  padding: 20px;
}

.qr-sheet-caption {
  margin: 0;
  max-width: 36ch;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #5d5d62;
  line-height: 1.7;
  word-break: break-word;
  direction: ltr;
}

.qr-sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 0.3mm solid #c8c8c8;
  color: #85858a;
  font-size: 11px;
  font-weight: 600;
}

.color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-muted);
}

.color-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 0;
  background: var(--ui-input);
  cursor: pointer;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset-btn {
  appearance: none;
  border: 1px solid var(--ui-border-strong);
  background: transparent;
  color: var(--ui-muted);
  min-height: 36px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.preset-btn:hover,
.preset-btn.is-active {
  border-color: var(--ui-accent);
  color: var(--ui-text);
  background: rgb(228 93 26 / 12%);
}

.preset-btn:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .app[data-view="edit"] .preview-panel { display: none; }
  .app[data-view="preview"] .editor-panel { display: none; }
  .app[data-view="preview"] .app-body { grid-template-columns: 1fr; }
}

@media print {
  .qr-sheet {
    box-shadow: none !important;
    border: 0 !important;
    min-height: 0 !important;
  }
}
