/* QR designer (templates/qr_generator/*.html) */
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 32px; }
.preview-col { position: sticky; top: 78px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; margin: 0 0 14px; }
.step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; }

.types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.type { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font: inherit; font-size: .8rem;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.type i { font-style: normal; font-size: 1.15rem; line-height: 1.2; }
.type:hover { border-color: var(--accent); }
.type.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.dyn-box { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.dyn-box.locked .switch { opacity: .7; }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { flex: none; width: 40px; height: 22px; margin-top: 2px; border-radius: 11px; background: var(--line); position: relative; transition: background .2s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .slider { cursor: not-allowed; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.presets button { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px; font: inherit; font-size: .82rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.presets button:hover { border-color: var(--accent); }
.presets i { width: 16px; height: 16px; border-radius: 4px; display: block; }

.sec { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.sec summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.sec:not([open]) summary { margin-bottom: 6px; }
.label-sm { font-size: .82rem; color: var(--muted); margin: 10px 0 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; padding: 8px 6px; font: inherit; font-size: .78rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .sw svg { width: 26px; height: 26px; display: block; }

.colors { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.colors label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.colors select { width: auto; padding: 6px 10px; }
input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.warn { color: var(--gold); margin: 10px 0 0; }

.logo-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.logo-drop { width: 110px; height: 110px; flex: none; display: grid; place-items: center; text-align: center; font-size: .78rem; color: var(--muted);
  border: 2px dashed var(--line); border-radius: var(--radius-sm); cursor: pointer; overflow: hidden; background: var(--surface-2); }
.logo-drop:hover, .logo-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.logo-drop .icon { width: 24px; height: 24px; color: var(--accent); }
.logo-drop img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.preview { display: flex; flex-direction: column; gap: 12px; }
.stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; border: 1px solid var(--line); padding: 16px; }
.stage img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; filter: drop-shadow(0 4px 14px rgb(0 0 0 / .08)); }
.stage p { text-align: center; padding: 0 20px; }
.spinner { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { margin: 0; min-height: 0; }
.status.bad { color: var(--bad); }
.status:empty { display: none; }
.dyn-result { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); display: flex; flex-direction: column; gap: 4px; }
.dyn-result code { flex: 1; font-size: .85rem; word-break: break-all; }
.tip { margin: 0; text-align: center; }

/* My QR codes */
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.qr-item { display: flex; gap: 14px; align-items: flex-start; }
.qr-item img { width: 84px; height: 84px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.qr-item h3 { margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-item .t { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-item .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.qr-item.off { opacity: .6; }
.big-qr { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.device-bars { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; }
.device-bars .r { display: grid; grid-template-columns: 70px 1fr 40px; gap: 8px; align-items: center; }
.device-bars .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.device-bars .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

@media (max-width: 820px) {
  .qr-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; order: -1; }
  .stage { max-width: 320px; margin: 0 auto; width: 100%; }
}
@media (max-width: 480px) {
  .types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .opt { min-width: 62px; }
}
