.dw-qr {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  color: var(--text);
  font-size: 12px;
}

.dw-qr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dw-qr-modes {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.dw-qr-mode {
  padding: 3px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.dw-qr-mode.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.dw-qr-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dw-qr-actions .dashboard-widget-icon-button:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.dw-qr-copied-icon {
  color: var(--green);
}

.dw-qr-stage {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  place-items: center;
  overflow: hidden;
}

.dw-qr-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: dw-qr-reveal 260ms ease;
}

.dw-qr-canvas--qr {
  width: auto;
  height: auto;
  aspect-ratio: 1;
}

.dw-qr-canvas.is-hidden {
  display: none;
}

.dw-qr-canvas--barcode {
  width: 100%;
}

.dw-qr-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.dw-qr-input {
  flex: 0 0 auto;
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  resize: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.dw-qr-input:focus-visible {
  outline: none;
  border-color: var(--w-accent, var(--accent));
  box-shadow: 0 0 0 2px var(--w-accent-soft, var(--accent-soft));
}

@keyframes dw-qr-reveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dw-qr-canvas {
    animation: none;
  }
}
