/* ============================================================================
   QR Code Generator (new 2026-10-22)
   Everything is scoped to .qrg-page or a qrg- class - no global :root / body /
   .tool-container rules. Light default, dark via [data-theme="dark"].
   Accent #339966 (Online Tools). Settings panel = compact option rows standard.
   Base layout shared with the Twitter Header Generator.
   ========================================================================== */
.qrg-page {
    --tool-accent: #339966;
    --primary: #2d8a5c;
    --primary-light: #dcf3e6;
    --primary-dark: #237a4f;
    --success: #339966;
    --success-light: #d1fae5;
    --warning: #b7791f;
    --warning-light: #fef3c7;
    --danger: #e64e4e;
    --danger-light: #fee2e2;
    --info-light: #e0f2fe;
    --btn-go: #237a4f;
    --btn-go-hover: #1b6140;
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --switch-off-bg: #cbd5e1;
    --switch-off-border: #b6c2d1;
    --switch-knob-border: rgba(15, 23, 42, 0.12);
    --checker: #e2e8f0;
    color: var(--text);
}
[data-theme="dark"] .qrg-page {
    --tool-accent: #4ade80;
    --primary: #4ade80;
    --primary-light: rgba(74, 222, 128, 0.14);
    --primary-dark: #86efac;
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.14);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.14);
    --info-light: rgba(77, 184, 232, 0.12);
    --btn-go: #1f7a4d;
    --btn-go-hover: #18623d;
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-secondary: #273449;
    --bg-tertiary: #334155;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #0f172a;
    --input-border: #475569;
    --switch-off-bg: #475569;
    --switch-off-border: #55657c;
    --switch-knob-border: rgba(0, 0, 0, 0.3);
    --checker: #334155;
}
.qrg-page *, .qrg-page *::before, .qrg-page *::after { box-sizing: border-box; }
.qrg-page [hidden] { display: none !important; }

/* ---------- header ---------- */
.qrg-page .tool-header { text-align: center; margin-bottom: 1.5rem; }
.qrg-page .qrg-title-row { display: flex; align-items: center; justify-content: center; gap: 0.85rem; margin-bottom: 0.85rem; }
.qrg-page .qrg-title-icon { width: 56px; height: 56px; border-radius: 12px; background: #339966; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qrg-page .qrg-title-icon svg { width: 28px; height: 28px; display: block; }
.qrg-page .tool-title { margin: 0; color: var(--primary); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; letter-spacing: -0.02em; }
.qrg-page .tool-description a { color: var(--primary); }

/* ---------- friendly error ---------- */
.qrg-page .qrg-err { display: flex; gap: 0.75rem; align-items: flex-start; background: var(--danger-light); border: 1px solid var(--danger); color: var(--text); border-radius: 12px; padding: 0.85rem 1rem; margin: 0 0 1rem; }
.qrg-page .qrg-err > svg { width: 20px; height: 20px; color: var(--danger); margin-top: 2px; flex-shrink: 0; }
.qrg-page .qrg-err-body { flex: 1; min-width: 0; }
.qrg-page .qrg-err-body p { margin: 0; line-height: 1.55; font-size: 0.93rem; overflow-wrap: anywhere; }
.qrg-page .qrg-err-body p + p { margin-top: 0.3rem; color: var(--text-muted); font-size: 0.86rem; }
.qrg-page .qrg-err a { color: var(--danger); font-weight: 600; }
.qrg-page .qrg-err-x { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; width: auto; }
.qrg-page .qrg-err-x:hover { color: var(--text); background: var(--bg-secondary); }
.qrg-page .qrg-err-x svg { width: 18px; height: 18px; }

/* ---------- editor grid ---------- */
.qrg-page .qrg-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.25rem; align-items: start; margin-bottom: 2.5rem; }
.qrg-page .qrg-preview-col, .qrg-page .qrg-controls { min-width: 0; }
.qrg-page .qrg-preview-col { position: sticky; top: 1rem; }

/* platform tabs (mode tabs) */
.qrg-page .qrg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 0.75rem; }
.qrg-page .qrg-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.5rem 0.25rem; border: 0; border-radius: 9px; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1.2; width: auto; min-width: 0; transition: background 0.15s, color 0.15s; }
.qrg-page .qrg-tab svg { width: 18px; height: 18px; }
.qrg-page .qrg-tab small { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.qrg-page .qrg-tab:hover { color: var(--text); background: var(--bg-elevated); }
.qrg-page .qrg-tab.active { background: var(--bg-elevated); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.qrg-page .qrg-tab.active small { color: var(--primary); }

/* preview */
.qrg-page .qrg-stage-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem; }
.qrg-page .qrg-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.qrg-page .qrg-stage-head span { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.qrg-page .qrg-stage-head svg { width: 16px; height: 16px; }
.qrg-page .qrg-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); background: var(--primary-light); color: var(--primary); font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qrg-page .qrg-stage { position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: repeating-conic-gradient(var(--checker) 0% 25%, transparent 0% 50%) 50% / 16px 16px; outline: 1px solid var(--border); }
.qrg-page .qrg-stage.drag { outline: 2px dashed var(--primary); outline-offset: 2px; }
.qrg-page .qrg-stage canvas { display: block; width: 100%; height: auto; }
.qrg-page .qrg-stage .qrg-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.qrg-page .qrg-stage-note { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; display: flex; gap: 0.4rem; align-items: flex-start; }
.qrg-page .qrg-stage-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

/* summary + actions under the preview */
.qrg-page .qrg-summary { margin-top: 0.75rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.85rem 1rem; }
.qrg-page .qrg-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; font-size: 0.88rem; }
.qrg-page .qrg-sum-main { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); min-width: 0; }
.qrg-page .qrg-sum-main svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.qrg-page .qrg-sum-main strong { color: var(--text); font-variant-numeric: tabular-nums; }
.qrg-page .qrg-limit { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-full); white-space: nowrap; }
.qrg-page .qrg-limit svg { width: 14px; height: 14px; }
.qrg-page .qrg-limit.ok { background: var(--success-light); color: var(--success); }
.qrg-page .qrg-limit.over { background: var(--warning-light); color: var(--warning); }
.qrg-page .qrg-limit.na { background: var(--bg-secondary); color: var(--text-muted); }
.qrg-page .qrg-actions { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0.5rem; margin-top: 0.8rem; }
.qrg-page .qrg-actions .qrg-btn-zip { grid-column: 1 / -1; }

/* buttons */
.qrg-page .qrg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.7rem 1rem; border-radius: 10px; font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; width: 100%; min-width: 0; line-height: 1.2; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.qrg-page .qrg-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.qrg-page .qrg-btn-primary { background: var(--btn-go); color: #fff; }
.qrg-page .qrg-btn-primary:hover { background: var(--btn-go-hover); }
.qrg-page .qrg-btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--input-border); }
.qrg-page .qrg-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.qrg-page .qrg-btn:disabled { opacity: 0.6; cursor: progress; }
.qrg-page .qrg-btn-sm { width: auto; padding: 0.45rem 0.75rem; font-size: 0.82rem; border-radius: 8px; }
.qrg-page .qrg-btn-sm svg { width: 15px; height: 15px; }
.qrg-page .qrg-linkbtn { background: none; border: 0; padding: 0; width: auto; color: var(--text-muted); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.qrg-page .qrg-linkbtn:hover { color: var(--primary); }
.qrg-page .qrg-linkbtn svg { width: 14px; height: 14px; }

.qrg-page .qrg-toast { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--success); font-weight: 600; display: flex; gap: 0.4rem; align-items: center; }
.qrg-page .qrg-toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- cards in the controls column ---------- */
.qrg-page .qrg-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.1rem; margin-bottom: 0.875rem; }
.qrg-page .qrg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.qrg-page .qrg-card-title { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.95rem; color: var(--text); margin: 0; }
.qrg-page .qrg-card-title svg { width: 17px; height: 17px; color: var(--primary); }
.qrg-page .qrg-cap { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0.85rem 0 0.45rem; }

/* templates */
.qrg-page .qrg-tpls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.qrg-page .qrg-tpl { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-elevated); cursor: pointer; width: auto; min-width: 0; font: inherit; color: var(--text-secondary); transition: border-color 0.15s; }
.qrg-page .qrg-tpl canvas { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 6px; background: var(--bg-secondary); }
.qrg-page .qrg-tpl span { font-size: 0.74rem; font-weight: 600; line-height: 1.2; padding: 0 2px 2px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrg-page .qrg-tpl:hover { border-color: var(--primary); }
.qrg-page .qrg-tpl.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.qrg-page .qrg-tpl.active span { color: var(--primary); }

/* saved designs */
.qrg-page .qrg-designs { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.qrg-page .qrg-design { display: inline-flex; align-items: center; border: 1px solid var(--input-border); border-radius: var(--radius-full); background: var(--bg-elevated); overflow: hidden; max-width: 100%; }
.qrg-page .qrg-design.active { border-color: var(--primary); background: var(--primary-light); }
.qrg-page .qrg-design-apply { border: 0; background: none; padding: 0.3rem 0.35rem 0.3rem 0.75rem; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text); cursor: pointer; width: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.qrg-page .qrg-design.active .qrg-design-apply { color: var(--primary); }
.qrg-page .qrg-design-del { border: 0; background: none; padding: 0.3rem 0.55rem 0.3rem 0.2rem; color: var(--text-muted); cursor: pointer; display: inline-flex; width: auto; }
.qrg-page .qrg-design-del:hover { color: var(--danger); }
.qrg-page .qrg-design-del svg { width: 13px; height: 13px; }
.qrg-page .qrg-empty { font-size: 0.8rem; color: var(--text-muted); }
.qrg-page .qrg-save-row { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.qrg-page .qrg-save-row input { flex: 1; min-width: 0; }

/* text inputs (main setting) */
.qrg-page .qrg-field { margin-bottom: 0.7rem; }
.qrg-page .qrg-field:last-child { margin-bottom: 0; }
.qrg-page .qrg-field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; }
.qrg-page .qrg-field-label em { font-style: normal; font-weight: 500; color: var(--text-muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.tool-container .qrg-page input.qrg-input, .qrg-page input.qrg-input {
    width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0.6rem 0.75rem !important; border: 1px solid var(--input-border) !important; border-radius: 9px !important;
    background: var(--input-bg) !important; color: var(--text) !important; font: inherit !important; font-size: 0.92rem !important; height: auto !important; box-shadow: none !important; line-height: 1.35 !important;
}
.qrg-page input.qrg-input:focus { outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--primary-light) !important; }
.qrg-page input.qrg-input::placeholder { color: var(--text-muted); opacity: 1; }

/* ---------- compact option rows ---------- */
.qrg-page .qrg-adv { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 0.875rem; }
.qrg-page .qrg-adv-row + .qrg-adv-row { border-top: 1px solid var(--border); }
.qrg-page .qrg-adv-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 52px; padding: 0.6rem 1rem; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--text); border-radius: 0; }
.qrg-page .qrg-adv-head:hover { background: var(--bg-secondary); }
.qrg-page .qrg-adv-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.qrg-page .qrg-adv-left, .qrg-page .qrg-adv-right { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.qrg-page .qrg-adv-right { flex-shrink: 0; gap: 0.45rem; }
.qrg-page .qrg-adv-left > svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.qrg-page .qrg-adv-text { display: flex; flex-direction: column; min-width: 0; }
.qrg-page .qrg-adv-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.qrg-page .qrg-adv-hint { font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrg-page .qrg-adv-value { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--radius-full); background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.75rem; font-weight: 700; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.qrg-page .qrg-adv-chev { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.2s; }
.qrg-page .qrg-adv-row.open .qrg-adv-chev { transform: rotate(180deg); }
.qrg-page .qrg-adv-row.open .qrg-adv-head, .qrg-page .qrg-adv-row.open .qrg-adv-body { background: var(--bg-secondary); }
.qrg-page .qrg-adv-body { padding: 0.25rem 1rem 1rem; }

/* segmented controls */
.qrg-page .qrg-seg { display: flex; gap: 3px; padding: 3px; background: var(--bg-tertiary); border-radius: 9px; }
.qrg-page .qrg-seg button { flex: 1 1 0; min-width: 0; border: 0; background: transparent; padding: 0.42rem 0.4rem; border-radius: 7px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; white-space: nowrap; width: auto; }
.qrg-page .qrg-seg button svg { width: 15px; height: 15px; }
.qrg-page .qrg-seg button:hover { color: var(--text); }
.qrg-page .qrg-seg button.active { background: var(--bg-elevated); color: var(--primary); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }

/* range + labelled controls */
.qrg-page .qrg-ctl { margin-top: 0.75rem; }
.qrg-page .qrg-ctl-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; gap: 0.5rem; }
.qrg-page .qrg-ctl-label output { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.tool-container .qrg-page input[type="range"].qrg-range, .qrg-page input[type="range"].qrg-range { width: 100% !important; margin: 0 !important; accent-color: var(--primary); height: 22px; background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.qrg-page .qrg-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.qrg-page .qrg-two > * { min-width: 0; }

/* colour inputs */
.qrg-page .qrg-colors { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.qrg-page .qrg-color { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.tool-container .qrg-page input[type="color"].qrg-color-in, .qrg-page input[type="color"].qrg-color-in { -webkit-appearance: none; appearance: none; width: 34px !important; height: 34px !important; min-width: 34px; padding: 2px !important; margin: 0 !important; border: 1px solid var(--input-border) !important; border-radius: 9px !important; background: var(--input-bg) !important; cursor: pointer; box-shadow: none !important; }
.qrg-page input[type="color"].qrg-color-in::-webkit-color-swatch-wrapper { padding: 0; }
.qrg-page input[type="color"].qrg-color-in::-webkit-color-swatch { border: 0; border-radius: 6px; }
.qrg-page input[type="color"].qrg-color-in::-moz-color-swatch { border: 0; border-radius: 6px; }
.qrg-page .qrg-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.qrg-page .qrg-swatch { width: 26px; height: 26px; min-width: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(15, 23, 42, 0.18); cursor: pointer; }
.qrg-page .qrg-swatch:hover { transform: scale(1.1); }
.qrg-page .qrg-iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--input-border); background: var(--bg-elevated); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.qrg-page .qrg-iconbtn:hover { color: var(--primary); border-color: var(--primary); }
.qrg-page .qrg-iconbtn svg { width: 16px; height: 16px; }

/* pattern + font pickers */
.qrg-page .qrg-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.qrg-page .qrg-pick button { border: 1px solid var(--input-border); background: var(--bg-elevated); border-radius: 8px; padding: 0.5rem 0.25rem; font: inherit; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; min-width: 0; width: auto; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrg-page .qrg-pick button svg { width: 18px; height: 18px; }
.qrg-page .qrg-pick button:hover { border-color: var(--primary); }
.qrg-page .qrg-pick button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.qrg-page .qrg-fonts button { font-size: 1rem; padding: 0.55rem 0.25rem; color: var(--text); }
.qrg-page .qrg-fonts button small { font-family: inherit; font-size: 0.66rem; color: var(--text-muted); font-weight: 600; }
.qrg-page .qrg-fonts button.active small { color: var(--primary); }

/* upload buttons */
.qrg-page .qrg-upload { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.qrg-page .qrg-upload-name { font-size: 0.8rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex: 1; }
.qrg-page .qrg-hint { font-size: 0.78rem; color: var(--text-muted); margin: 0.5rem 0 0; line-height: 1.5; }
.qrg-page .qrg-hint a { color: var(--primary); }

/* switches (ON/OFF label beside) */
.qrg-page .qrg-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.75rem; font-size: 0.84rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.qrg-page .qrg-switch-row > span:first-child { min-width: 0; }
.qrg-page .qrg-switch-wrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.qrg-page .qrg-onoff { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; width: 2.1em; color: var(--text-muted); }
.qrg-page .qrg-onoff.on { color: var(--primary); }

.tool-container input[type="checkbox"].qrg-switch,
input[type="checkbox"].qrg-switch {
    -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
    box-sizing: border-box !important; position: relative !important; display: inline-block !important;
    width: 44px !important; min-width: 44px !important; max-width: 44px !important;
    height: 24px !important; min-height: 24px !important; padding: 0 !important; margin: 0 !important;
    border: 1px solid var(--switch-off-border) !important; border-radius: 9999px !important;
    background: var(--switch-off-bg) !important; background-color: var(--switch-off-bg) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important; cursor: pointer !important; flex-shrink: 0 !important; outline: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}
.tool-container input[type="checkbox"].qrg-switch:checked,
input[type="checkbox"].qrg-switch:checked { background: var(--primary) !important; background-color: var(--primary) !important; border-color: var(--primary) !important; box-shadow: none !important; }
.tool-container input[type="checkbox"].qrg-switch:focus-visible,
input[type="checkbox"].qrg-switch:focus-visible { box-shadow: 0 0 0 3px var(--primary-light) !important; }
.tool-container input[type="checkbox"].qrg-switch::after,
.tool-container input[type="checkbox"].qrg-switch:checked::after,
input[type="checkbox"].qrg-switch::after,
input[type="checkbox"].qrg-switch:checked::after {
    content: '' !important; position: absolute !important; top: 2px !important; left: 2px !important; right: auto !important; bottom: auto !important;
    width: 18px !important; height: 18px !important; margin: 0 !important; padding: 0 !important; font-size: 0 !important;
    border-radius: 50% !important; border: 1px solid var(--switch-knob-border) !important; background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important; transform: none !important; transition: transform 0.2s ease !important;
}
.tool-container input[type="checkbox"].qrg-switch:checked::after,
input[type="checkbox"].qrg-switch:checked::after { transform: translateX(20px) !important; }

/* guard callouts (soft blue notice, amber warning) */
.qrg-page .qrg-note { display: flex; gap: 0.6rem; align-items: flex-start; border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.83rem; line-height: 1.5; margin-top: 0.75rem; border: 1px solid; }
.qrg-page .qrg-note svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.qrg-page .qrg-note p { margin: 0; min-width: 0; }
.qrg-page .qrg-note a { font-weight: 600; }
.qrg-page .qrg-note-info { background: var(--info-light); border-color: rgba(51, 153, 204, 0.35); color: var(--text); }
.qrg-page .qrg-note-info svg, .qrg-page .qrg-note-info a { color: #2a87b8; }
[data-theme="dark"] .qrg-page .qrg-note-info svg, [data-theme="dark"] .qrg-page .qrg-note-info a { color: #4db8e8; }
.qrg-page .qrg-note-warn { background: var(--warning-light); border-color: rgba(183, 121, 31, 0.4); color: var(--text); }
.qrg-page .qrg-note-warn svg, .qrg-page .qrg-note-warn a { color: var(--warning); }

/* ConvertICO ring loader overlay (ZIP build) */
.qrg-page .qrg-busy { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.qrg-page .qrg-busy-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem 2rem; min-width: 300px; text-align: center; }
.qrg-page .qrg-busy-card p { margin: 0.9rem 0 0; font-weight: 600; color: var(--text); }
.qrg-page .qrg-busy-card small { display: block; margin-top: 0.25rem; color: var(--text-muted); font-size: 0.82rem; }
.qrg-page .qrg-loader { display: block; width: 48px; height: 48px; margin: 0 auto; overflow: visible;
    --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .qrg-page .qrg-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.qrg-page .qrg-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.qrg-page .qrg-loader .bp { stroke: var(--cico-outer-soft); }
.qrg-page .qrg-loader .gp { stroke: var(--cico-mid-soft); }
.qrg-page .qrg-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: qrgSpinL 1.3s linear infinite; }
.qrg-page .qrg-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: qrgSpinR 2.1s linear infinite; }
.qrg-page .qrg-loader .r { stroke: var(--cico-inner); animation: qrgBreathe 1.3s ease-in-out infinite; }
@keyframes qrgSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes qrgSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes qrgBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
    .qrg-page .qrg-loader .b { animation-duration: 4s; }
    .qrg-page .qrg-loader .g { animation-duration: 6s; }
    .qrg-page .qrg-loader .r { animation: none; }
}

/* ---------- info sections ---------- */
.qrg-page .qrg-info { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.qrg-page .qrg-info-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.4rem 1.5rem; }
.qrg-page .qrg-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-size: 1.3rem; color: var(--text); }
.qrg-page .qrg-info-card h2 svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.qrg-page .qrg-info-card p { line-height: 1.7; color: var(--text-secondary); margin: 0 0 0.8rem; }
.qrg-page .qrg-info-card p:last-child { margin-bottom: 0; }
.qrg-page .qrg-info-card a { color: var(--primary); }
.qrg-page .qrg-table-wrap { overflow-x: auto; margin: 0.25rem 0 1rem; border: 1px solid var(--border); border-radius: 10px; }
.qrg-page .qrg-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 520px; }
.qrg-page .qrg-table th, .qrg-page .qrg-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.qrg-page .qrg-table th { background: var(--bg-secondary); color: var(--text); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.qrg-page .qrg-table tr:last-child td { border-bottom: 0; }
.qrg-page .qrg-table td:first-child { color: var(--text); font-weight: 600; }
.qrg-page .qrg-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 0.9rem; }
.qrg-page .qrg-feature { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 0.95rem 1rem; min-width: 0; }
.qrg-page .qrg-feature svg { width: 20px; height: 20px; color: var(--primary); }
.qrg-page .qrg-feature h3 { margin: 0.45rem 0 0.3rem; font-size: 0.98rem; color: var(--text); }
.qrg-page .qrg-feature p { font-size: 0.88rem; line-height: 1.6; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .qrg-page .qrg-editor { grid-template-columns: minmax(0, 1fr); }
    .qrg-page .qrg-preview-col { position: static; }
}
@media (max-width: 560px) {
    .qrg-page .qrg-tab small { display: none; }
    .qrg-page .qrg-tpls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .qrg-page .qrg-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .qrg-page .qrg-features { grid-template-columns: minmax(0, 1fr); }
    .qrg-page .qrg-actions { grid-template-columns: minmax(0, 1fr); }
    .qrg-page .qrg-info-card { padding: 1.1rem; }
    .qrg-page .qrg-adv-value { max-width: 90px; }
}

/* ======================= QR-specific ======================= */
/* content type picker (the main setting) */
.qrg-page .qrg-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin-bottom: 0.9rem; }
.qrg-page .qrg-types button { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.55rem 0.25rem; border: 1px solid var(--input-border); border-radius: 9px; background: var(--bg-elevated); color: var(--text-secondary); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; width: auto; min-width: 0; white-space: nowrap; }
.qrg-page .qrg-types button svg { width: 18px; height: 18px; }
.qrg-page .qrg-types button:hover { border-color: var(--primary); color: var(--text); }
.qrg-page .qrg-types button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qrg-page .qrg-form { display: flex; flex-direction: column; gap: 0.65rem; }
.qrg-page .qrg-form .qrg-field { margin: 0; }
.tool-container .qrg-page textarea.qrg-input, .qrg-page textarea.qrg-input,
.tool-container .qrg-page select.qrg-input, .qrg-page select.qrg-input {
    width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0.6rem 0.75rem !important; border: 1px solid var(--input-border) !important; border-radius: 9px !important;
    background: var(--input-bg) !important; color: var(--text) !important; font: inherit !important; font-size: 0.92rem !important; box-shadow: none !important; line-height: 1.4 !important; min-height: 0 !important;
}
.qrg-page textarea.qrg-input { resize: vertical; min-height: 84px !important; }
.qrg-page textarea.qrg-input:focus, .qrg-page select.qrg-input:focus { outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--primary-light) !important; }
.qrg-page .qrg-inline { display: flex; gap: 0.4rem; align-items: center; }
.qrg-page .qrg-inline > input { flex: 1; min-width: 0; }
.qrg-page .qrg-pass-btn { flex-shrink: 0; }

/* capacity meter */
.qrg-page .qrg-meter { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--border); }
.qrg-page .qrg-meter-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.qrg-page .qrg-meter-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.qrg-page .qrg-bar { height: 8px; background: var(--bg-tertiary); border-radius: 99px; overflow: hidden; }
.qrg-page .qrg-bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width 0.25s; }
.qrg-page .qrg-bar.warn span { background: var(--warning); }

/* preview */
.qrg-page .qrg-stage { background: repeating-conic-gradient(var(--checker) 0% 25%, transparent 0% 50%) 50% / 16px 16px; display: flex; align-items: center; justify-content: center; padding: 1rem; aspect-ratio: auto; min-height: 260px; }
.qrg-page .qrg-stage canvas { width: auto !important; max-width: 100%; max-height: 520px; height: auto; border-radius: 4px; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12); }
.qrg-page .qrg-scan { display: flex; align-items: flex-start; gap: 0.55rem; margin-top: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 10px; border: 1px solid var(--border); font-size: 0.84rem; line-height: 1.45; background: var(--bg-secondary); }
.qrg-page .qrg-scan svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.qrg-page .qrg-scan b { display: block; color: var(--text); }
.qrg-page .qrg-scan span { color: var(--text-secondary); }
.qrg-page .qrg-scan.good { background: var(--success-light); border-color: rgba(51, 153, 102, 0.4); }
.qrg-page .qrg-scan.good svg { color: var(--success); }
.qrg-page .qrg-scan.tight { background: var(--warning-light); border-color: rgba(183, 121, 31, 0.4); }
.qrg-page .qrg-scan.tight svg { color: var(--warning); }
.qrg-page .qrg-scan.bad { background: var(--danger-light); border-color: rgba(230, 78, 78, 0.45); }
.qrg-page .qrg-scan.bad svg { color: var(--danger); }
.qrg-page .qrg-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.7rem; }
.qrg-page .qrg-spec { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 9px; padding: 0.45rem 0.5rem; min-width: 0; }
.qrg-page .qrg-spec small { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
.qrg-page .qrg-spec strong { display: block; font-size: 0.86rem; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrg-page .qrg-formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.75rem; }
.qrg-page .qrg-actions { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* shape pickers draw a tiny preview of each option */
.qrg-page .qrg-shapes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
.qrg-page .qrg-shapes button { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.45rem 0.2rem 0.4rem; border: 1px solid var(--input-border); border-radius: 9px; background: var(--bg-elevated); color: var(--text-secondary); font: inherit; font-size: 0.72rem; font-weight: 600; cursor: pointer; width: auto; min-width: 0; white-space: nowrap; }
.qrg-page .qrg-shapes button canvas { width: 34px; height: 34px; display: block; }
.qrg-page .qrg-shapes button:hover { border-color: var(--primary); }
.qrg-page .qrg-shapes button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qrg-page .qrg-sub { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0.9rem 0 0.45rem; display: block; }
.qrg-page .qrg-sub:first-child { margin-top: 0.4rem; }
.qrg-page .qrg-icons { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.qrg-page .qrg-icons button { aspect-ratio: 1; border: 1px solid var(--input-border); border-radius: 8px; background: var(--bg-elevated); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; width: auto; min-width: 0; }
.qrg-page .qrg-icons button svg { width: 18px; height: 18px; }
.qrg-page .qrg-icons button:hover { border-color: var(--primary); color: var(--primary); }
.qrg-page .qrg-icons button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qrg-page .qrg-ecl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.qrg-page .qrg-ecl button { display: flex; flex-direction: column; align-items: center; padding: 0.45rem 0.2rem; border: 1px solid var(--input-border); border-radius: 9px; background: var(--bg-elevated); font: inherit; cursor: pointer; width: auto; min-width: 0; color: var(--text); }
.qrg-page .qrg-ecl button b { font-size: 1rem; }
.qrg-page .qrg-ecl button small { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.qrg-page .qrg-ecl button.active { border-color: var(--primary); background: var(--primary-light); }
.qrg-page .qrg-ecl button.active b, .qrg-page .qrg-ecl button.active small { color: var(--primary); }

/* "how it works" anatomy legend in the info section */
.qrg-page .qrg-anat { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 1.25rem; align-items: center; margin-bottom: 0.9rem; }
.qrg-page .qrg-anat canvas { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.qrg-page .qrg-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1rem; margin: 0; padding: 0; list-style: none; font-size: 0.86rem; color: var(--text-secondary); }
.qrg-page .qrg-legend li { display: flex; gap: 0.5rem; align-items: flex-start; line-height: 1.4; }
.qrg-page .qrg-legend i { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; margin-top: 3px; display: block; }
.qrg-page .qrg-legend b { color: var(--text); }
@media (max-width: 960px) { .qrg-page .qrg-stage canvas { max-height: 360px; } }
@media (max-width: 560px) {
    .qrg-page .qrg-types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .qrg-page .qrg-types button { font-size: 0.7rem; }
    .qrg-page .qrg-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qrg-page .qrg-shapes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .qrg-page .qrg-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .qrg-page .qrg-anat { grid-template-columns: minmax(0, 1fr); }
    .qrg-page .qrg-legend { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 2026-10-22 evening: payment / app forms, PDF, share, batch ---------- */
.qrg-page .qrg-hint.warn { color: var(--warning); font-weight: 600; }
.qrg-page .qrg-hint-top { margin: 0 0 0.6rem; }
.qrg-page .qrg-types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qrg-page .qrg-cm-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.qrg-page .qrg-cm-row .qrg-field-label { margin: 0; }
.tool-container .qrg-page .qrg-cm-row input.qrg-input, .qrg-page .qrg-cm-row input.qrg-input { width: 110px !important; flex: 0 0 110px; }
.qrg-page .qrg-share { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.75rem; padding: 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; }
.qrg-page .qrg-share .qrg-inline .qrg-btn { width: auto; flex-shrink: 0; }
.qrg-page .qrg-share .qrg-hint { margin: 0; }
.tool-container .qrg-page textarea.qrg-batch-text, .qrg-page textarea.qrg-batch-text { font-family: ui-monospace, "SF Mono", Consolas, monospace !important; font-size: 0.82rem !important; min-height: 120px !important; white-space: pre; }
.qrg-page .qrg-batch-preview { margin-top: 0.7rem; }
.qrg-page .qrg-batch-preview p { margin: 0 0 0.45rem; font-size: 0.84rem; color: var(--text-secondary); }
.qrg-page .qrg-batch-preview .qrg-table { min-width: 0; font-size: 0.78rem; }
.qrg-page .qrg-batch-preview .qrg-table td, .qrg-page .qrg-batch-preview .qrg-table th { padding: 0.35rem 0.5rem; overflow-wrap: anywhere; }
.qrg-page #qrgBatchGo { margin-top: 0.75rem; }
.qrg-page .qrg-busy-card .qrg-btn { width: auto; margin-top: 0.9rem; }
.qrg-page .qrg-formats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 560px) {
    .qrg-page .qrg-formats button { font-size: 0.74rem; padding-left: 0.2rem; padding-right: 0.2rem; }
}
