.qr-editor { width: min(760px, calc(100vw - 20px)); padding: 0; max-height: calc(100dvh - 20px); border-radius: 8px; overflow: auto; }
.qr-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 18px; }
.qr-editor h2 { font-size: 18px; margin: 0 0 5px; }
.qr-editor header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.qr-editor-body { padding: 16px 18px; }
.qr-source-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--strong); border-radius: 6px; margin-bottom: 16px; }
.qr-source-tabs button { min-height: 44px; background: transparent; color: var(--muted); border: 0; border-radius: 4px; cursor: pointer; font-size: 13px; }
.qr-source-tabs [aria-selected="true"] { background: var(--panel); color: var(--navigation-accent); font-weight: 650; box-shadow: 0 1px 3px #0001; }
.qr-editor [hidden], .qr-preparation [hidden] { display: none !important; }
.qr-editor [data-qr-url-form] > label { display: block; font-size: 12px; margin-bottom: 8px; }
.qr-editor [data-qr-url-form] > div { display: flex; gap: 8px; }
.qr-editor .input { min-width: 0; font-size: 14px; min-height: 44px; }
.qr-editor [data-qr-encode] { flex: none; font-size: 12px; padding-inline: 10px; min-height: 44px; }
.qr-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.qr-upload .button { min-height: 44px; font-size: 13px; }
.qr-upload svg { width: 18px; height: 18px; }
.qr-upload small { font-size: 11px; color: var(--muted); }
.qr-crop { width: 100%; padding-block: 12px; border-block: 1px solid var(--line); }
.qr-crop p { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0 0 10px; }
.qr-crop-stage { position: relative; overflow: hidden; margin-inline: auto; max-width: 100%; touch-action: pan-y; }
.qr-crop-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qr-crop .qr-crop-selection { position: absolute; padding: 0; border: 2px solid var(--navigation-accent); background: transparent; box-shadow: 0 0 0 1000px #0006; touch-action: none; cursor: move; }
.qr-crop .qr-crop-selection:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.qr-crop > label { display: flex; gap: 12px; align-items: center; font-size: 12px; margin: 10px 0; }
.qr-crop input { min-width: 0; flex: 1; min-height: 44px; accent-color: var(--navigation-accent); }
.qr-crop [data-crop-extract] { width: 100%; }
.qr-status { min-height: 20px; color: var(--navigation-accent); font-size: 12px; line-height: 1.7; margin: 12px 0; }
.qr-stage { position: relative; width: min(100%, 400px); margin-inline: auto; min-height: 100px; background: var(--strong); overflow: hidden; isolation: isolate; }
.qr-stage .qr-poster { width: 100%; height: auto; display: block; }
.qr-overlay { position: absolute; aspect-ratio: 1; padding: 0; border: 0; outline: 2px solid #317cff; background: #fff; box-shadow: 0 0 0 2px #ffffffaa, 0 2px 10px #0003; cursor: grab; touch-action: none; user-select: none; }
.qr-overlay:active { cursor: grabbing; }
.qr-overlay:focus-visible { outline: 3px solid #111; }
.qr-overlay img { width: 100%; height: 100%; display: block; pointer-events: none; image-rendering: pixelated; }
.qr-only { width: 190px; height: 190px; display: grid; place-items: center; margin-block: 20px; }
.qr-only .qr-overlay { position: static; width: 176px; height: 176px; outline: none; box-shadow: none; cursor: default; }
.qr-empty { display: grid; place-items: center; min-height: 100px; font-size: 12px; color: var(--muted); }
.qr-payload { max-height: 56px; overflow: auto; overflow-wrap: anywhere; color: var(--muted); font: 11px/1.6 monospace; margin: 12px 0; padding: 6px 0; }
.qr-position-controls > label { display: flex; justify-content: space-between; font-size: 13px; }
.qr-position-controls input { width: 100%; min-height: 40px; accent-color: var(--navigation-accent); }
.qr-align { display: flex; gap: 8px; }
.qr-align .button { min-height: 44px; font-size: 12px; }
.qr-editor > footer { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; z-index: 3; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
.qr-editor footer .button { min-height: 48px; font-size: 13px; }
.qr-preparation { display: flex; align-items: center; gap: 10px; padding: 14px 0; margin-block: 12px; border-block: 1px solid var(--line); grid-column: 1 / -1; }
.qr-preparation-icon { flex: none; width: 28px; color: var(--navigation-accent); }
.qr-preparation-icon svg { width: 26px; height: 26px; }
.qr-preparation > div { flex: 1; min-width: 0; }
.qr-preparation b { font-size: 13px; }
.qr-preparation small { font-size: 10px; margin-left: 5px; color: var(--muted); font-weight: 400; }
.qr-preparation p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 4px 0 0; }
.qr-preparation .button { min-height: 44px; font-size: 12px; padding-inline: 12px; }
.qr-preparation [data-clear-qr] { width: 34px; min-height: 44px; font-size: 20px; }
.source-poster-delivery > [data-poster-qr] { width: 100%; min-height: 48px; margin-bottom: 16px; }
.source-poster-delivery > [data-qr-saved] { width: 100%; min-height: 44px; margin-bottom: 16px; }
@media (max-width: 600px) {
  .qr-editor .input { font-size: 16px; }
  .qr-editor-body { padding-inline: 14px; }
  .qr-editor > header, .qr-editor > footer { padding-inline: 14px; }
  .qr-editor footer .primary { flex: 1; }
}
