/* Satnam Siri WaheGuru Shaib Ji */
/* qrgen.css — QR Generator UI. Uses the shared tokens from main.css (light + dark). The QR
   preview card itself is styled inline by the engine; this styles the tool chrome around it. */

.qg-main { padding-top: 22px; padding-bottom: 60px; }
.qg-main [hidden] { display: none !important; }
.qg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qg-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.qg-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.qg-head-txt { flex: 1; min-width: 0; }
.qg-head-txt h1 { font-size: clamp(1.4rem, 1rem + 1.9vw, 2rem); letter-spacing: -.02em; margin: 0; }
.qg-head-txt p { margin: 3px 0 0; color: var(--muted); font-size: .92rem; }
.qg-head .pill { margin-left: auto; align-self: flex-start; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--bg-3); }
.pill svg { width: 14px; height: 14px; }
.pill-client { color: var(--c-teal); border-color: color-mix(in srgb, var(--c-teal) 40%, var(--border)); }

/* desktop: content stacks in column 1, preview sticky in column 2 (unchanged layout) */
.qg-layout { display: grid; grid-template-columns: 1fr 400px; gap: 16px 18px; align-items: start; }
.qg-layout > .qg-card { min-width: 0; }
.qg-content   { grid-column: 1; grid-row: 1; }
.qg-customise { grid-column: 1; grid-row: 2; }
.qg-adv       { grid-column: 1; grid-row: 3; }
.qg-batch     { grid-column: 1; grid-row: 4; }
.qg-preview-card { grid-column: 2; grid-row: 1 / 5; position: sticky; top: 82px; align-self: start; }

.qg-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.qg-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.qg-ch-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-3); color: var(--accent); display: grid; place-items: center; flex: none; }
.qg-ch-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.qg-card-head h2 { font-size: 1rem; margin: 0; letter-spacing: -.01em; }
.qg-card-head p { margin: 1px 0 0; font-size: .82rem; color: var(--muted); }
.qg-seclabel { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; margin: 2px 0 8px; }

/* type chips */
.qg-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; margin-bottom: 14px; }
.qg-type { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: .86rem; font-weight: 550; cursor: pointer; }
.qg-type:hover { border-color: var(--accent); }
.qg-type.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.qg-type .emo { font-size: 1rem; line-height: 1; flex: none; }
.qg-type-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qg-type-more { border-style: dashed; color: var(--muted); font-weight: 600; }
.qg-type-more .emo { letter-spacing: -1px; }

/* fields */
.qg-fields { display: flex; flex-direction: column; gap: 12px; }
.qg-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.qg-field input[type=text], .qg-field input[type=password], .qg-field input[type=number], .qg-field textarea, .qg-field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; outline: 0; }
.qg-field input:focus, .qg-field textarea:focus, .qg-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qg-field textarea { min-height: 78px; resize: vertical; }
.qg-field .hint { font-size: .76rem; color: var(--faint); margin-top: 4px; }
.qg-field-row { display: flex; gap: 10px; }
.qg-field-row > * { flex: 1; }
.qg-toggle-field { display: flex; align-items: center; gap: 9px; }

/* tabs */
.qg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-2); margin-bottom: 14px; }
.qg-tab { padding: 8px 4px; margin-bottom: -1px; font-size: .9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.qg-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* presets — saved-by-you on top, built-ins below; capped at ~2 rows then scrolls (mobile: horizontal) */
.qg-gallery { max-height: 280px; overflow-y: auto; overflow-x: hidden; padding-right: 3px; }
.qg-gallery::-webkit-scrollbar { width: 6px; }
.qg-gallery::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.qg-presets, .qg-mypresets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.qg-mypresets:not(:empty) { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-2); }
.qg-mypresets:empty { display: none; }
.qg-preset { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px 8px; background: var(--bg-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .12s, transform .12s; }
.qg-preset:hover { border-color: var(--accent); transform: translateY(-2px); }
.qg-preset.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qg-preset .thumb { width: 100%; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.qg-preset .thumb svg { width: 82%; height: 82%; }
.qg-preset .name { font-size: .74rem; color: var(--muted); font-weight: 600; }
.qg-preset .tick { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; }
.qg-preset .tick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; }
.qg-preset.is-active .tick { display: grid; }
.qg-preset .del { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--faint); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.qg-preset .del:hover { color: var(--c-red); }
.qg-preset .del svg { width: 13px; height: 13px; }

/* custom controls */
.qg-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.qg-ctrl { display: flex; flex-direction: column; gap: 5px; }
.qg-ctrl.full { grid-column: 1 / -1; }
.qg-ctrl label { font-size: .8rem; font-weight: 600; color: var(--text); }
.qg-ctrl select, .qg-ctrl input[type=text] { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: .88rem; }
.qg-ctrl input[type=range] { width: 100%; }
.qg-colorrow { display: flex; align-items: center; gap: 8px; }
.qg-colorrow input[type=color] { width: 38px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.qg-colorrow input[type=text] { flex: 1; font-family: ui-monospace, monospace; font-size: .82rem; }
.qg-range-val { font-size: .78rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.qg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.qg-seg button { padding: 7px 10px; font-size: .82rem; color: var(--muted); background: var(--bg-2); }
.qg-seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

.qg-saverow { margin-top: 14px; }
.qg-mini { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-size: .84rem; font-weight: 600; }
.qg-mini:hover { border-color: var(--accent); color: var(--accent); }
.qg-mini svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* advanced */
.qg-adv { padding: 0; }
.qg-adv-toggle { width: 100%; display: flex; align-items: center; gap: 11px; padding: 16px 18px; text-align: left; }
.qg-adv-toggle h2 { font-size: 1rem; margin: 0; }
.qg-adv-toggle p { margin: 1px 0 0; font-size: .82rem; color: var(--muted); }
.qg-adv-toggle .qg-chev { width: 18px; height: 18px; margin-left: auto; color: var(--faint); transition: transform .15s; fill: none; stroke: currentColor; stroke-width: 2; }
.qg-adv.open .qg-chev { transform: rotate(180deg); }
.qg-adv-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }

/* batch card */
.qg-batch { display: flex; align-items: center; gap: 12px; }
.qg-batch-txt { flex: 1; }
.qg-batch-txt h2 { font-size: 1rem; margin: 0; }
.qg-batch-txt p { margin: 1px 0 0; font-size: .82rem; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; font-size: .9rem; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: .92; }
.btn .ic, .qg-reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* preview */
.qg-preview-card { display: flex; flex-direction: column; }
.qg-card-head .qg-reset { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: .82rem; font-weight: 600; }
.qg-card-head .qg-reset:hover { text-decoration: underline; }
.qg-stage { display: grid; place-items: center; padding: 26px 10px; background: var(--bg-3); border-radius: var(--radius-sm); perspective: 1000px; min-height: 240px; }
.qg-preview { display: inline-block; }
.qg-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.qg-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border-2); }
.qg-chip svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; }
.qg-chip .l1 { font-size: .8rem; font-weight: 700; line-height: 1.1; }
.qg-chip .l2 { font-size: .72rem; color: var(--muted); }
.qg-chip.ok { color: var(--ok); } .qg-chip.warn { color: var(--c-amber); }
.qg-chip.ok .l2, .qg-chip.warn .l2 { color: var(--muted); }
.qg-export { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qg-export .btn-primary { grid-column: 1 / -1; }
.qg-export [data-exp="print"] { grid-column: 1 / -1; }
.qg-export svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.qg-warnbox svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; }
.qg-export-hint { text-align: center; font-size: .76rem; color: var(--faint); margin: 10px 0 0; }
.qg-warnbox { grid-column: 1 / -1; font-size: .8rem; color: var(--c-amber); background: color-mix(in srgb, var(--c-amber) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c-amber) 30%, var(--border)); border-radius: 8px; padding: 8px 10px; margin-top: 2px; }

/* rotating tips */
.qg-tips { position: relative; display: flex; align-items: center; gap: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.qg-tip { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.qg-tip-ic { width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--c-green) 14%, transparent); color: var(--c-green); display: grid; place-items: center; flex: none; }
.qg-tip-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.qg-tip strong { font-size: .84rem; display: block; }
.qg-tip p { margin: 1px 0 0; font-size: .84rem; color: var(--muted); }
.qg-tip-nav { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.qg-tip-nav:hover { border-color: var(--accent); color: var(--accent); }
.qg-tip-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.qg-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.qg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.qg-dots i.on { background: var(--accent); }

/* batch panel */
.qg-batch-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; }
.qg-batch-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); background: var(--bg-2); border-left: 1px solid var(--border); z-index: 61; padding: 22px; overflow-y: auto; box-shadow: var(--shadow-md); }
.qg-batch-panel h2 { margin: 0 0 4px; font-size: 1.2rem; }
.qg-batch-panel .sub { color: var(--muted); font-size: .88rem; margin: 0 0 16px; }
.qg-batch-panel textarea { width: 100%; min-height: 140px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-family: ui-monospace, monospace; font-size: .85rem; resize: vertical; }
.qg-batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.qg-batch-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qg-batch-item .lbl { font-size: .72rem; color: var(--muted); word-break: break-all; text-align: center; }
.qg-batch-item .err { font-size: .72rem; color: var(--c-red); }
.qg-batch-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.qg-batch-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.qg-batch-close:hover { background: var(--bg-3); }
.qg-batch-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

@media (max-width: 920px) {
  /* mobile reflow (UI_KIT/10.png): content → preview → customise → advanced → batch → tips.
     Every card is full-width and uniform; the preview is a clean card in the flow (not sticky). */
  .qg-layout { display: flex; flex-direction: column; gap: 16px; }
  .qg-layout > .qg-card { width: 100%; grid-column: auto; grid-row: auto; position: static; }
  .qg-content   { order: 1; }
  .qg-preview-card { order: 2; }
  .qg-customise { order: 3; }
  .qg-adv       { order: 4; }
  .qg-batch     { order: 5; }
}
@media (max-width: 900px) {
  /* status chips (scan-safe / capacity / version) are desktop-only; keep the mobile preview clean */
  .qg-chips { display: none; }
}
/* under 750px the icon tile spans the full height of the head (same as the other tools) */
@media (max-width: 750px) {
  .qg-head { align-items: stretch; }
  .qg-ic { height: auto; align-self: stretch; }
}
@media (max-width: 560px) {
  .qg-head { gap: 12px; margin-bottom: 18px; }
  .qg-head-txt p { font-size: .86rem; }
  .qg-custom { grid-template-columns: 1fr; }
  .qg-gallery { max-height: 232px; }
  /* type chips: 4 per row like the mockup (compact, label stays on one line) */
  .qg-types { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .qg-type { padding: 9px 3px; gap: 3px; font-size: .76rem; letter-spacing: -.2px; }
  .qg-type .emo { font-size: .76rem; flex: 0 0 auto; }
  /* export: Download full-width, then SVG · Copy · Print in one 3-col row (mockup) */
  .qg-export { grid-template-columns: repeat(3, 1fr); }
  .qg-export [data-exp="print"] { grid-column: auto; }
  /* batch: keep icon + text on one line, drop the button full-width below (no skinny wrapping) */
  .qg-batch { flex-wrap: wrap; }
  .qg-batch-txt { min-width: 0; }
  .qg-batch .btn-primary { flex: 1 0 100%; justify-content: center; }
}
@media (max-width: 430px) {
  .qg-head .pill { display: none; }
}
/* hayerapps · v0.1.0 */
