/* ==========================================================
   QR Studio — estilos
   ========================================================== */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f0f1f9;
  --border: #e4e6f2;
  --text: #171a2e;
  --muted: #6b7090;
  --primary: #6d5dfc;
  --primary-2: #8f5cff;
  --primary-soft: rgba(109, 93, 252, .12);
  --danger: #e5484d;
  --success: #17a870;
  --warn: #e69a14;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 26, 46, .04), 0 8px 24px rgba(23, 26, 46, .06);
  --shadow-lg: 0 20px 50px rgba(60, 40, 160, .18);
  --sidebar-w: 264px;
  --bottom-nav-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0f1c;
  --surface: #151829;
  --surface-2: #1c2036;
  --border: #272c47;
  --text: #eceefb;
  --muted: #9097bb;
  --primary-soft: rgba(143, 124, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--muted); font-weight: 400; font-size: .85em; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; z-index: 20;
}
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; padding: 0 32px 48px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px rgba(109, 93, 252, .4);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; line-height: 1.15; }
.brand-text small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 600; font-size: .95rem; transition: .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-count { margin-left: auto; background: var(--primary); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 99px; }

.side-card {
  margin-top: auto; padding: 16px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-2)); position: relative; overflow: hidden;
}
.side-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.side-card-icon { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.side-card p { font-size: .8rem; opacity: .9; margin-top: 4px; }
.theme-toggle { width: 100%; justify-content: flex-start; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0 18px; background: linear-gradient(var(--bg) 78%, transparent);
}
.topbar h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.topbar p { color: var(--muted); font-size: .92rem; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.mobile-only { display: none !important; }

/* ---------- Tema (ícones) ---------- */
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem; transition: .15s; white-space: nowrap;
  border: 1px solid transparent; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 18px rgba(109, 93, 252, .35); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(109, 93, 252, .45); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { filter: brightness(.96); }
.btn-ghost { color: var(--muted); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.link-btn { color: var(--primary); font-weight: 600; font-size: .85rem; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.card-head h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.card-head p { color: var(--muted); font-size: .87rem; }
.step { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .88rem; color: var(--primary); background: var(--primary-soft); }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
.editor-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.editor-preview { position: sticky; top: 104px; }
.editing-banner {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-size: .9rem;
}

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: .84rem; color: var(--muted); transition: .15s;
}
.type-btn svg { width: 24px; height: 24px; }
.type-btn:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.type-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.card > .field.full + .field.full { margin-top: 18px; }
.field label, .field > .lbl { font-weight: 600; font-size: .85rem; }
.field .req { color: var(--danger); }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); outline: none; transition: .15s; font-size: .95rem;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field .help { font-size: .78rem; color: var(--muted); }
.row-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }

.color-input { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 5px 8px 5px 5px; background: var(--surface); }
.color-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.color-input input[type="color"] { width: 38px; height: 34px; border: 0; border-radius: 9px; padding: 0; background: none; cursor: pointer; flex: none; }
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 9px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 9px; }
.color-input input[type="text"] { border: 0; padding: 6px 4px; box-shadow: none !important; font-family: ui-monospace, monospace; text-transform: uppercase; }
.inline-pair { display: flex; gap: 10px; align-items: center; }
.inline-pair select { width: 110px; flex: none; }

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.preset { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--border); position: relative; overflow: hidden; transition: .15s; }
.preset:hover { transform: scale(1.05); }
.preset.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.preset i { position: absolute; inset: 22%; border-radius: 6px; }

.switch { display: flex; align-items: center; gap: 12px; margin-top: 14px; cursor: pointer; font-weight: 500; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.slider { width: 42px; height: 24px; border-radius: 99px; background: var(--border); position: relative; transition: .2s; flex: none; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 4px var(--primary-soft); }

input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: var(--border); padding: 0; border: 0; outline: none; width: 100%; box-shadow: none !important; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(109, 93, 252, .5); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); border: 3px solid var(--surface); cursor: pointer; }
output { color: var(--primary); font-weight: 700; margin-left: 4px; font-size: .82rem; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface); transition: .15s; }
.choice svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.choice:hover { border-color: var(--primary); }
.choice.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); max-width: 100%; }
.segmented button { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: .85rem; color: var(--muted); transition: .15s; }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.segmented.small button { padding: 8px 11px; }
#eccChoices { display: flex; }
#eccChoices button { flex: 1; }

.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 84px; height: 84px; border-radius: 16px; border: 2px dashed var(--border); display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: .72rem; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#logoOptions { margin-top: 16px; }

/* ---------- Preview ---------- */
.preview-card { padding: 20px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .78rem; }
.qr-stage {
  position: relative; display: grid; place-items: center; padding: 22px; border-radius: var(--radius);
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--border); aspect-ratio: 1; overflow: hidden;
}
.qr-holder { width: 100%; max-width: 320px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; box-shadow: var(--shadow-lg); transition: opacity .2s, filter .2s; }
.qr-holder canvas, .qr-holder svg { width: 100% !important; height: 100% !important; display: block; border-radius: 6px; }
.qr-stage.is-empty .qr-holder { opacity: .18; filter: blur(3px); }
.qr-empty { display: none; position: absolute; inset: 0; place-items: center; text-align: center; padding: 20px; font-weight: 700; color: var(--muted); }
.qr-stage.is-empty .qr-empty { display: grid; }

.preview-meta { margin: 16px 0 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.preview-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta code { font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: 6px 10px; border-radius: 8px; max-height: 64px; overflow: hidden; word-break: break-all; display: block; }
.tips { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.tips li { font-size: .8rem; padding: 8px 12px; border-radius: 10px; display: flex; gap: 8px; align-items: flex-start; }
.tips li.ok { background: rgba(23, 168, 112, .12); color: var(--success); }
.tips li.warn { background: rgba(230, 154, 20, .14); color: var(--warn); }
.tips li.bad { background: rgba(229, 72, 77, .12); color: var(--danger); }
.download-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.download-row .btn { flex: 1; min-width: 120px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.draft-note { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 12px; }

/* ---------- Biblioteca ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.8rem; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 500; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 44px; }
.toolbar select { width: auto; flex: 0 1 180px; }
.chip-toggle input { position: absolute; opacity: 0; }
.chip-toggle span { display: inline-block; padding: 11px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; cursor: pointer; background: var(--surface); color: var(--muted); }
.chip-toggle input:checked + span { border-color: var(--warn); color: var(--warn); background: rgba(230, 154, 20, .12); }
.chip-toggle input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-soft); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .2s; }
.qr-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.qr-card-thumb { position: relative; display: grid; place-items: center; padding: 22px; background: var(--surface-2); }
.qr-card-thumb .thumb { width: 160px; height: 160px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); display: grid; place-items: center; }
.qr-card-thumb .thumb canvas, .qr-card-thumb .thumb svg { width: 100% !important; height: 100% !important; }
.fav-btn { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); }
.fav-btn.on { color: var(--warn); }
.fav-btn.on svg { fill: currentColor; }
.qr-card-body { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.qr-card-body h3 { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-card-body code { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.qr-card-body small { color: var(--muted); font-size: .75rem; }
.qr-card-actions { display: flex; gap: 6px; padding: 12px 16px 16px; }
.qr-card-actions .btn { flex: 1; padding: 8px 10px; font-size: .82rem; }
.qr-card-actions .icon-sm { flex: none; width: 36px; padding: 0; }
.qr-card-actions .icon-sm svg { width: 17px; height: 17px; }
.qr-card-actions .danger:hover { color: var(--danger); border-color: var(--danger); }

.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); }
.empty-art { font-size: 3.4rem; color: var(--primary); line-height: 1; margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 6px 0 18px; }
.skeleton { height: 330px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%) 0 0 / 200% 100%; animation: sk 1.3s infinite; border: 1px solid var(--border); }
@keyframes sk { to { background-position: -200% 0; } }

.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.help-grid h3 { margin-bottom: 8px; font-size: 1.02rem; }
.help-grid p { color: var(--muted); font-size: .92rem; }

/* ---------- Modal / toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 12, 30, .55); backdrop-filter: blur(4px); }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 26px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-box h3 { margin-bottom: 6px; }
.modal-box p { color: var(--muted); font-size: .92rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: slide .25s ease-out; max-width: 340px; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
@keyframes slide { from { transform: translateY(14px); opacity: 0; } }

.bottom-nav { display: none; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 25;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 99px; color: #fff; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 28px rgba(109, 93, 252, .5);
}
:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1260px) {
  .editor { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1060px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 20px calc(var(--bottom-nav-h) + 32px); }
  .mobile-only { display: grid !important; }
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
  .qr-stage { aspect-ratio: auto; padding: 18px; }
  .qr-holder { max-width: 260px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .bottom-nav a.active { color: var(--primary); }
  .toasts { bottom: calc(var(--bottom-nav-h) + 16px); right: 16px; left: 16px; align-items: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main { padding-left: 14px; padding-right: 14px; }
  .topbar { padding: 16px 0 12px; }
  .topbar h1 { font-size: 1.3rem; }
  .topbar p { display: none; }
  .btn-primary span.hide-sm, .topbar .btn span { display: none; }
  .topbar .btn { width: 42px; height: 42px; padding: 0; }
  .card { padding: 16px; }
  .fields, .row-fields { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .type-btn { padding: 12px 4px; font-size: .78rem; }
  .btn-row { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .qr-card-thumb { padding: 14px; }
  .qr-card-thumb .thumb { width: 100%; height: auto; aspect-ratio: 1; max-width: 160px; }
  .qr-card-actions .btn:not(.icon-sm) span { display: none; }
  .qr-card-actions { padding: 10px 12px 14px; }
  .toolbar select { flex: 1 1 140px; }
  .stat b { font-size: 1.45rem; }
}
@media (max-width: 400px) {
  .lib-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
