/* QRGate web generator UI — dark theme, myqrcode-like layout */
:root{
  --qg-bg: #0b0b0b;
  --qg-card: rgba(31,31,31,0.95);
  --qg-card2: rgba(41,41,41,0.92);
  --qg-line: rgba(255,255,255,0.12);
  --qg-muted: rgba(255,255,255,0.72);
  --qg-muted2: rgba(255,255,255,0.58);
  --qg-text: #ffffff;
  --qg-blue: #2e73ff;
  --qg-green: #00c853;
  --qg-cyan: #00b0ff;
  --qg-red: #ff5252;
  --qg-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

#qgApp, #qgApp *, #qgApp *::before, #qgApp *::after{ box-sizing: border-box; }

body{ background: var(--qg-bg); color: var(--qg-text); overflow-x: hidden; }

/* ─── Hero ─── */
.qg-hero{ margin:0 0 18px; padding:0; border:0; background:transparent; box-shadow:none; }
.qg-hero-title{ font-size:26px; font-weight:800; letter-spacing:-0.02em; color:var(--qg-text); }
.qg-hero-sub{ margin-top:6px; color:var(--qg-muted); line-height:1.5; }

.qg-hidden{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; clip-path:inset(50%); }

/* ─── Grid ─── */
.qg-app{
  display:grid;
  grid-template-columns: 560px 320px;
  gap:16px;
  align-items:start;
  justify-content:center;
}
@media(max-width:980px){ .qg-app{ grid-template-columns:minmax(0,1fr); } }
@media(min-width:981px){ .qg-right{ position:sticky; top:24px; } }
@media(max-width:768px){ .qg-right{ display:none !important; } }

.qg-left{
  position:relative;
  background:transparent;
  border:1px solid transparent;
  border-radius:16px;
  box-shadow:none;
  padding:0;
  display:flex;
  flex-direction:column;
  width:100%;
  min-width:0;
}
.qg-right{
  position:relative;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  width:100%;
  max-width:320px;
  max-height:calc(100vh - 48px);
}
@media(max-width:980px){ .qg-right{ align-items:center; position:static; } }

/* ─── Wizard ─── */
.qg-wizard{ display:flex; flex-direction:column; gap:14px; flex:1; padding:20px 20px 14px; }
.qg-stepper{ display:none; }
.qg-step{ display:none; }
.qg-step.is-active{ display:block; animation:qgIn 240ms ease both; }

/* ─── Footer (wizard navigation bar) ─── */
.qg-wizard-footer{
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 20px 16px;
  border-top:1px solid var(--qg-line);
  background:rgba(11,11,11,0.95);
  backdrop-filter:blur(10px);
  container-type:inline-size;
}
.qg-footer-steps{
  display:flex;
  align-items:center;
  gap:8px;
  justify-content:center;
  flex:1;
  min-width:0;
  overflow:hidden;
}
/* Hide step labels when footer is narrow */
@container (max-width:500px){
  .qg-steplabel{ display:none; }
  .qg-footer-steps{ gap:4px; }
  .qg-stepsep{ font-size:10px; }
}
.qg-stepchip{ display:flex; align-items:center; gap:6px; user-select:none; }
.qg-stepsep{ color:rgba(255,255,255,0.30); font-weight:900; font-size:13px; }
.qg-stepcircle{
  width:26px; height:26px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:12px;
  background:rgba(255,255,255,0.10);
  color:rgba(255,255,255,0.60);
}
.qg-stepchip.is-active .qg-stepcircle,
.qg-stepchip.is-completed .qg-stepcircle{
  background:var(--qg-blue); color:#fff;
}
.qg-stepchip.is-completed .qg-stepcircle{ font-size:0; position:relative; }
.qg-stepchip.is-completed .qg-stepcircle::after{ content:"✓"; font-size:12px; font-weight:950; }
.qg-steplabel{ font-size:13px; font-weight:800; color:rgba(255,255,255,0.50); }
.qg-stepchip.is-active .qg-steplabel{ color:#fff; }

.qg-wiz-btn{
  flex:0 0 auto;
  min-height:44px;
  border-radius:12px;
  font-weight:800;
  font-size:15px;
  border:1px solid var(--qg-line);
  background:var(--qg-card);
  color:var(--qg-text);
  cursor:pointer;
  padding:0 16px;
  white-space:nowrap;
  transition:transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.qg-wiz-btn:hover{ transform:translateY(-1px); }
.qg-wiz-btn.primary{
  border:0;
  background:var(--qg-blue);
  color:#fff;
  padding:0 20px;
  box-shadow:0 10px 24px rgba(46,115,255,0.20);
}
.qg-wiz-btn.secondary{ padding:0 14px; }
.qg-wiz-btn[disabled]{ opacity:0.45; cursor:not-allowed; transform:none; }

/* ─── Tabs (hidden in wizard mode) ─── */
.qg-tabs{ display:none; padding:20px 20px 0; }
.qg-tab{
  appearance:none;
  border:1px solid var(--qg-line);
  background:rgba(255,255,255,0.04);
  color:var(--qg-text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  transition:transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.qg-tab:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.06); }
.qg-tab.is-active{
  background:linear-gradient(135deg, rgba(46,115,255,0.40), rgba(0,176,255,0.26));
  border-color:rgba(46,115,255,0.55);
}
.qg-pane{ display:none; }
.qg-pane.is-active{ display:flex; flex-direction:column; flex:1; animation:qgIn 260ms ease both; }
.qg-pane[data-pane="my"]{ padding:20px; }

/* ─── Sections ─── */
.qg-section{ padding:12px 0; border-top:1px solid var(--qg-line); }
.qg-section:first-of-type{ border-top:0; padding-top:0; }
.qg-section-title{
  font-size:12px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--qg-muted2);
  font-weight:900;
  margin-bottom:10px;
}
/* Step 2 (Content): keep equal spacing between all data cards */
.qg-step[data-step="content"] .qg-section{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.qg-step[data-step="content"] .qg-section-title{
  margin-bottom:0;
}

/* ─── Fields ─── */
.qg-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.qg-field > span{ color:var(--qg-muted); font-size:13px; font-weight:700; }
.qg-input{
  width:100%;
  padding:11px 12px;
  border-radius:10px;
  border:1px solid var(--qg-line);
  background:var(--qg-card2);
  color:var(--qg-text);
  font-size:14px;
  outline:none;
  transition:border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.qg-input:focus{
  border-color:rgba(46,115,255,0.65);
  box-shadow:0 0 0 3px rgba(46,115,255,0.18);
  background:rgba(55,55,55,0.92);
}
.qg-textarea{ min-height:92px; resize:vertical; }

.qg-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
@media(max-width:560px){ .qg-grid2{ grid-template-columns:1fr; } }

.qg-check{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--qg-muted);
  font-size:12px;
  font-weight:800;
  padding:8px 0;
  border-radius:0;
  border:0;
  background:transparent;
}
.qg-check input{ width:18px; height:18px; accent-color:var(--qg-blue); }

/* ─── Type grid (2-column like iOS app) ─── */
.qg-type-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:0;
}
@media(max-width:560px){ .qg-type-grid{ grid-template-columns:1fr 1fr; gap:8px; } }
.qg-type-card{
  appearance:none;
  border:1px solid var(--qg-line);
  background:var(--qg-card2);
  border-radius:16px;
  padding:20px 12px 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:var(--qg-text);
  cursor:pointer;
  box-shadow:none;
  transition:transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.qg-type-card:hover{ transform:translateY(-2px); background:rgba(255,255,255,0.06); }
.qg-type-card.is-selected{ border-color:var(--qg-blue); box-shadow:0 0 0 2px rgba(46,115,255,0.25); }
.qg-type-icon{
  width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,0.92);
  background:transparent;
  border:0;
  border-radius:0;
  flex-shrink:0;
}
.qg-type-icon svg{ width:32px; height:32px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.qg-type-text{ display:flex; flex-direction:column; gap:2px; min-width:0; text-align:center; }
.qg-type-title{ font-weight:700; text-align:center; line-height:1.2; font-size:13px; }
.qg-type-sub{ display:none; }

/* (mobile sticky removed — handled in responsive section below) */

.qg-type{ display:none; }
.qg-type.is-active{ display:block; animation:qgIn 200ms ease both; }
.qg-type-fields{ width:100%; }
.qg-type-fields .qg-type.is-active{ width:100%; }

.qg-or{
  margin:10px 0;
  color:rgba(255,255,255,0.45);
  text-align:center;
  font-weight:800;
  letter-spacing:0.08em;
  text-transform:uppercase;
  font-size:11px;
}

/* ─── Repeaters ─── */
.qg-rep{
  border:1px dashed rgba(255,255,255,0.14);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,0.02);
}
.qg-rep-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.qg-rep-list{ display:flex; flex-direction:column; gap:10px; }
.qg-rep-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.qg-rep-row > *{ min-width:0; }
.qg-rep-row input{ flex:1 1 220px; }
.qg-rep-row select{ flex:0 1 180px; }
.qg-rep-row [data-remove]{ margin-left:auto; }

/* ─── Buttons ─── */
.qg-mini{
  appearance:none;
  border:1px solid var(--qg-line);
  background:rgba(255,255,255,0.04);
  color:var(--qg-text);
  padding:9px 12px;
  border-radius:10px;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
  transition:transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.qg-mini:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.06); }
.qg-mini.danger{ border-color:rgba(255,82,82,0.35); background:rgba(255,82,82,0.10); color:#fff; }
.qg-mini.danger:hover{ background:rgba(255,82,82,0.16); }

.qg-logo-presets{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.qg-chip{
  appearance:none;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.03);
  color:#fff;
  padding:8px 10px;
  border-radius:999px;
  font-weight:900;
  cursor:pointer;
  transition:transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.qg-chip:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.05); }
.qg-chip.is-active{
  background:linear-gradient(135deg, rgba(0,200,83,0.25), rgba(0,176,255,0.18));
  border-color:rgba(0,200,83,0.35);
}

/* ─── Right sidebar ─── */
.qg-status{ color:var(--qg-muted); font-size:11px; text-align:center; min-height:16px; }

/* Floating mode toggle pill */
.qg-mode{
  display:inline-flex;
  align-items:center;
  gap:0;
  background:rgba(31,31,31,0.92);
  border:1.5px solid rgba(255,255,255,0.14);
  border-radius:999px;
  padding:4px;
  box-shadow:0 8px 30px rgba(0,0,0,0.40);
}
.qg-mode-btn{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--qg-muted);
  padding:9px 16px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  transition:background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.qg-mode-btn svg{ width:16px; height:16px; flex-shrink:0; }
.qg-mode-btn.is-active{
  background:var(--qg-blue);
  color:#fff;
  box-shadow:0 4px 16px rgba(46,115,255,0.35);
}

/* Phone content panes */
.qg-phone-content{ display:none; }
.qg-phone-content.is-active{ display:flex; flex-direction:column; flex:1; }

/* ─── Phone mockup — fixed iPhone 15 proportions, WHITE frame ─── */
.qg-phone{
  width:300px;
  min-height:480px;
  border-radius:46px;
  border:7px solid #e8e8ee;
  background:#fff;
  box-shadow:0 24px 64px rgba(0,0,0,0.45);
  overflow:hidden;
  position:relative;
  flex-shrink:0;
  display:flex;
  flex-direction:column;
}

/* Status bar */
.qg-phone-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 24px 0;
  background:#f0f0f6;
  position:relative;
  z-index:1;
}
.qg-phone-time{ font-size:14px; font-weight:700; color:#111; }
.qg-phone-notch{
  width:110px; height:30px;
  background:#e8e8ee;
  border-radius:0 0 20px 20px;
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
}
.qg-phone-icons{
  display:flex;
  align-items:center;
  gap:5px;
  color:#111;
}
.qg-phone-icons svg{ display:block; }

/* URL bar */
.qg-phone-bar{
  padding:10px 14px;
  background:#f0f0f6;
  display:flex;
  align-items:center;
  gap:8px;
}
.qg-phone-url{
  font-size:13px;
  color:#555;
  background:#fff;
  border:1px solid #e0e2e8;
  border-radius:10px;
  padding:8px 12px;
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
}
.qg-phone-globe{ width:14px; height:14px; color:#888; flex-shrink:0; }

/* QR inside phone */
.qg-phone-qr{
  padding:24px;
  display:flex;
  justify-content:center;
  align-items:center;
  background:#fff;
  flex:1;
}
.qg-phone-qr img{
  width:min(100%, 240px);
  height:auto;
  image-rendering:auto;
}

/* ─── Preview iframe inside phone ─── */
.qg-phone-iframe{
  width:100%;
  flex:1;
  min-height:400px;
  border:0;
  background:#fff;
  display:block;
}

/* ─── Primary button ─── */
.qg-actions{ display:flex; flex-wrap:wrap; gap:10px; }
.qg-primary{
  appearance:none;
  border:0;
  background:var(--qg-blue);
  color:#fff;
  font-weight:900;
  padding:11px 14px;
  border-radius:14px;
  cursor:pointer;
  box-shadow:0 12px 24px rgba(46,115,255,0.22);
  transition:transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.qg-primary:hover{ transform:translateY(-1px) scale(1.01); filter:saturate(1.06); box-shadow:0 16px 30px rgba(46,115,255,0.26); }

/* ─── Output / Links ─── */
.qg-output{
  margin-top:2px;
  border-top:1px solid var(--qg-line);
  padding-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.qg-out-row{ display:flex; flex-direction:column; gap:6px; }
.qg-out-label{ font-size:12px; color:var(--qg-muted); font-weight:800; letter-spacing:0.03em; }
.qg-output a{ word-break:break-all; color:#a9c6ff; font-weight:800; }

.qg-hint{ color:var(--qg-muted); font-size:12px; line-height:1.5; }

/* ─── My QRs / Analytics ─── */
.qg-my-actions{ display:flex; gap:10px; align-items:center; margin-top:10px; }
.qg-ana{
  margin-top:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  border-radius:16px;
  padding:12px;
}
.qg-ana-head{ font-weight:950; letter-spacing:-0.01em; }
.qg-ana-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:10px; }
.qg-ana-tile{
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  border-radius:14px;
  padding:10px;
}
.qg-ana-label{ font-size:12px; color:rgba(255,255,255,0.62); font-weight:800; }
.qg-ana-value{ font-size:20px; font-weight:950; margin-top:2px; }
.qg-ana-sub{ margin-top:10px; font-size:12px; color:rgba(255,255,255,0.62); font-weight:850; letter-spacing:0.02em; }
#qgAnaChart{
  margin-top:8px;
  width:100%;
  height:160px;
  border-radius:14px;
  background:rgba(0,0,0,0.20);
  border:1px solid rgba(255,255,255,0.08);
}
.qg-ana-breakdown{ margin-top:8px; display:flex; flex-direction:column; gap:8px; }
.qg-ana-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.02);
}
.qg-ana-row strong{ font-weight:900; }
.qg-ana-row span{ color:rgba(255,255,255,0.62); font-size:12px; }
.qg-my-list{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
.qg-my-item{
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  border-radius:16px;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.qg-my-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.qg-my-thumb{
  width:54px; height:54px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(255,255,255,0.10);
  object-fit:contain;
  padding:4px;
}
.qg-my-item strong{ display:block; }
.qg-my-meta{ color:rgba(255,255,255,0.62); font-size:12px; margin-top:2px; }
.qg-my-actions2{ display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }

/* ─── Templates grid ─── */
.qg-templates{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:10px; }
@media(max-width:560px){ .qg-templates{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.qg-template{
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  border-radius:16px;
  padding:10px;
  cursor:pointer;
  transition:transform 160ms ease, border-color 160ms ease, background 160ms ease;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.qg-template:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.05); }
.qg-template.is-active{ border-color:rgba(0,176,255,0.55); background:rgba(46,115,255,0.10); }
.qg-template img{ width:100%; height:auto; border-radius:12px; background:#fff; padding:6px; }
.qg-template .qg-template-name{
  font-size:12px; font-weight:900;
  color:rgba(255,255,255,0.78);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ─── Accordion (DisclosureGroupCard) ─── */
.qg-design-stack{ display:flex; flex-direction:column; gap:14px; }
.qg-disclosure{
  border-radius:14px;
  background:var(--qg-card);
  box-shadow:0 6px 18px rgba(0,0,0,0.22);
  border:1px solid rgba(255,255,255,0.08);
  overflow:hidden;
}
.qg-disclosure > summary{
  list-style:none;
  cursor:pointer;
  padding:16px 18px;
  user-select:none;
  display:flex;
  align-items:center;
  gap:14px;
}
.qg-disclosure > summary::-webkit-details-marker{ display:none; }

/* Icon box before title */
.qg-disclosure > summary::before{ content:none; }
.qg-disclosure[data-disc] > summary::before{
  content:"";
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(46,115,255,0.12);
  flex-shrink:0;
  background-repeat:no-repeat;
  background-position:center;
  background-size:18px 18px;
}
/* Chevron */
.qg-disclosure > summary::after{
  content:"";
  margin-left:auto;
  width:20px; height:20px;
  flex-shrink:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.50)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center;
  transition:transform 200ms ease;
}
.qg-disclosure[open] > summary::after{ transform:rotate(180deg); }
.qg-disc-title{ font-weight:800; color:var(--qg-text); font-size:15px; }
.qg-disc-sub{ color:var(--qg-muted); font-size:13px; line-height:1.35; margin-top:2px; }
.qg-disc-body{ padding:0 18px 18px; }
.qg-disc-text{ display:flex; flex-direction:column; flex:1; min-width:0; }

/* Accordion icons */
.qg-disclosure[data-disc="frame"] > summary::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232e73ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M8 8h8v8H8z'/%3E%3C/svg%3E");
}
.qg-disclosure[data-disc="pattern"] > summary::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%232e73ff'%3E%3Crect x='5' y='5' width='4' height='4' rx='1'/%3E%3Crect x='10' y='5' width='4' height='4' rx='1'/%3E%3Crect x='15' y='5' width='4' height='4' rx='1'/%3E%3Crect x='5' y='10' width='4' height='4' rx='1'/%3E%3Crect x='10' y='10' width='4' height='4' rx='1'/%3E%3Crect x='15' y='10' width='4' height='4' rx='1'/%3E%3Crect x='5' y='15' width='4' height='4' rx='1'/%3E%3Crect x='10' y='15' width='4' height='4' rx='1'/%3E%3Crect x='15' y='15' width='4' height='4' rx='1'/%3E%3C/svg%3E");
}
.qg-disclosure[data-disc="corners"] > summary::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232e73ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h6v6H7z'/%3E%3Cpath d='M13 7h4v4'/%3E%3Cpath d='M7 13v4h4'/%3E%3C/svg%3E");
}
.qg-disclosure[data-disc="logo"] > summary::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232e73ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Cpath d='M8 14l2-2 3 3 2-2 3 3'/%3E%3Cpath d='M9 9h0'/%3E%3C/svg%3E");
}

/* ─── Subtitle inside accordion ─── */
.qg-subtitle{
  font-weight:800;
  color:var(--qg-text);
  font-size:14px;
  margin:6px 0 10px;
}

/* ─── Carousels ─── */
.qg-carousel{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:8px 0 14px;
  scroll-snap-type:x proximity;
}
.qg-carousel::-webkit-scrollbar{ height:6px; }
.qg-carousel::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.12); border-radius:999px; }

.qg-cardrow{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:6px 0 14px;
}
.qg-cardrow::-webkit-scrollbar{ height:6px; }
.qg-cardrow::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.12); border-radius:999px; }

/* ─── Pattern / Corner pick cards ─── */
.qg-pickcard{
  width:64px; height:64px;
  border-radius:12px;
  border:1.5px solid var(--qg-line);
  background:rgba(255,255,255,0.06);
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.qg-pickcard:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.08); }
.qg-pickcard.is-selected{
  border-color:var(--qg-blue);
  box-shadow:0 0 0 2px rgba(46,115,255,0.25);
}
.qg-pickicon{ width:38px; height:38px; }
.qg-pickicon svg{ width:100%; height:100%; }

/* ─── Logo preset cards ─── */
.qg-logo-row{ padding-top:2px; }
.qg-logo-card{
  width:56px; height:56px;
  border-radius:12px;
  border:1.5px solid var(--qg-line);
  background:rgba(255,255,255,0.02);
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.qg-logo-card:hover{ transform:translateY(-1px); background:rgba(255,255,255,0.05); }
.qg-logo-card.is-selected{ border-color:var(--qg-blue); box-shadow:0 0 0 2px rgba(46,115,255,0.25); }
.qg-logo-card img{ width:28px; height:28px; filter:invert(1) brightness(1.05); opacity:0.92; }
.qg-logo-card .qg-logo-none{ font-weight:950; color:var(--qg-muted); }

/* ─── Logo upload card ─── */
.qg-logo-upload{ margin-top:12px; }
.qg-logo-upload-btn{
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius:14px;
  border:1px dashed rgba(46,115,255,0.55);
  background:transparent;
  color:var(--qg-text);
  cursor:pointer;
}
.qg-logo-upload-btn:hover{ background:rgba(46,115,255,0.06); }
.qg-logo-upload-preview{
  width:44px; height:44px;
  border-radius:10px;
  background:var(--qg-card2);
  border:1px solid var(--qg-line);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.qg-logo-upload-preview img{ width:100%; height:100%; object-fit:cover; display:block; }
.qg-logo-upload-icon{ color:rgba(46,115,255,0.92); font-weight:900; }
.qg-logo-upload-title{ font-weight:900; }
.qg-logo-upload-sub{ font-size:12px; color:var(--qg-muted); margin-top:4px; }
.qg-logo-upload-actions{ display:flex; justify-content:flex-end; margin-top:10px; }

/* ─── Result sheet ─── */
.qg-sheet-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.55);
  opacity:0;
  pointer-events:none;
  transition:opacity 180ms ease;
  z-index:60;
}
.qg-sheet-overlay.is-open{ opacity:1; pointer-events:auto; }
.qg-sheet{
  position:fixed;
  left:0; right:0; bottom:0;
  transform:translateY(110%);
  transition:transform 220ms ease;
  z-index:61;
  padding:16px;
}
.qg-sheet.is-open{ transform:translateY(0); }
.qg-sheet-card{
  max-width:520px;
  margin:0 auto;
  background:rgba(21,21,21,0.96);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:20px;
  box-shadow:0 30px 90px rgba(0,0,0,0.65);
  padding:16px;
  color:var(--qg-text);
}
.qg-sheet-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.qg-sheet-title{ font-weight:950; }
.qg-sheet-preview{ margin-top:12px; display:flex; justify-content:center; }
.qg-sheet-preview img{
  width:200px; height:300px;
  border-radius:12px;
  background:#fff;
  padding:0;
  object-fit:contain;
}
.qg-sheet-row{ margin-top:12px; }
.qg-sheet-actions{ margin-top:12px; display:flex; flex-wrap:wrap; gap:10px; }
.qg-sheet-links{ margin-top:12px; }
.qg-noscroll{ overflow:hidden; }

/* ─── Frame style / template cards ─── */
.qg-frame-card{
  width:86px;
  flex:0 0 auto;
  scroll-snap-align:start;
  cursor:pointer;
}
.qg-frame-preview{
  width:86px; height:86px;
  border-radius:12px;
  background:#fff;
  position:relative;
  overflow:hidden;
  border:2px solid transparent;
}
.qg-frame-card.is-selected .qg-frame-preview{
  border-color:var(--qg-blue);
  box-shadow:0 0 0 3px rgba(46,115,255,0.20);
}
.qg-frame-preview img{
  width:100%; height:100%;
  object-fit:contain;
  display:block;
  padding:6px;
}
.qg-frame-label{
  margin-top:6px;
  font-size:11px;
  font-weight:700;
  color:var(--qg-muted2);
  text-align:center;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ─── Color fields (inline like myqrcode reference) ─── */
.qg-form-row{ margin-top:10px; display:flex; flex-direction:column; gap:12px; }
.qg-colorgrid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
  margin-top:32px;
}
.qg-colorfield{
  flex:1 1 200px;
  border:0;
  background:transparent;
  border-radius:0;
  padding:0;
}
.qg-colorlabel{ font-size:12px; font-weight:800; color:var(--qg-muted); margin-bottom:6px; }
.qg-colorrow{ display:flex; gap:8px; align-items:center; }
.qg-hex{
  flex:1;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--qg-line);
  background:var(--qg-card2);
  color:var(--qg-text);
  font-size:14px;
  outline:none;
}
.qg-hex:focus{ border-color:rgba(46,115,255,0.65); box-shadow:0 0 0 3px rgba(46,115,255,0.18); }
.qg-color{
  width:40px; height:38px;
  border-radius:10px;
  border:0;
  background:transparent;
  padding:0;
  cursor:pointer;
}
.qg-color::-webkit-color-swatch-wrapper{ padding:0; }
.qg-color::-webkit-color-swatch{ border:0; border-radius:10px; }
.qg-color::-moz-color-swatch{ border:0; border-radius:10px; }

.qg-input[type="color"]{
  padding:0; height:38px;
  border:0;
  background:transparent;
}
.qg-input[type="color"]::-webkit-color-swatch-wrapper{ padding:0; }
.qg-input[type="color"]::-webkit-color-swatch{ border:0; border-radius:10px; }
.qg-input[type="color"]::-moz-color-swatch{ border:0; border-radius:10px; }

/* Swap button inline between color pairs */
.qg-swap-btn{
  appearance:none;
  border:1px solid var(--qg-line);
  background:var(--qg-card2);
  color:var(--qg-muted);
  width:36px; height:36px;
  border-radius:10px;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
  flex:0 0 auto;
  align-self:flex-end;
  margin-bottom:4px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background 160ms ease, transform 160ms ease;
}
.qg-swap-btn:hover{ background:rgba(255,255,255,0.10); transform:scale(1.05); }
#qgSwapFrameColors{
  align-self:center;
  padding:8px 14px;
}

/* ─── Animations ─── */
@keyframes qgIn{
  from{ opacity:0; transform:translateY(8px); }
  to{ opacity:1; transform:translateY(0); }
}
@keyframes qgShimmer{
  0%{ transform:translateX(-70%) rotate(0.0001deg); opacity:0; }
  18%{ opacity:0.85; }
  55%{ opacity:0.25; }
  100%{ transform:translateX(70%) rotate(0.0001deg); opacity:0; }
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE (≤ 768px)
   ══════════════════════════════════════════════ */
@media(max-width:768px){

  /* ── Hero ── */
  .qg-hero{ margin:0 0 12px; overflow:hidden; }
  .qg-hero-title{ font-size:20px; word-break:break-word; }
  .qg-hero-sub{ font-size:13px; }

  /* ── Layout ── */
  .qg-app{ gap:0; overflow:hidden; width:100%; max-width:100%; }
  .qg-left{
    border-radius:14px;
    padding:0;
    border:1px solid transparent;
    background:transparent;
    overflow:visible;
    min-width:0;
    width:100%;
    max-width:100%;
  }
  .qg-wizard{ padding:14px 14px 10px; }
  .qg-pane[data-pane="my"]{ padding:14px; }
  .qg-step{ overflow:hidden; min-width:0; max-width:100%; }

  /* ── Wizard footer ── */
  .qg-wizard-footer{
    margin:0;
    padding:10px 14px 12px;
    border-radius:0 0 14px 14px;
    gap:6px;
    flex-wrap:wrap;
  }
  .qg-footer-steps{ gap:2px; flex:1 1 auto; min-width:0; justify-content:center; }
  .qg-steplabel{ display:none; }
  .qg-stepcircle{ width:22px; height:22px; font-size:11px; }
  .qg-stepsep{ font-size:9px; }
  .qg-wiz-btn{ min-height:38px; font-size:14px; padding:0 12px; flex-shrink:0; }
  .qg-wiz-btn.primary{ padding:0 14px; }

  /* ── Type grid ── */
  .qg-type-grid{ gap:8px; }
  .qg-type-card{ padding:14px 8px 12px; border-radius:14px; }
  .qg-type-icon{ width:36px; height:36px; }
  .qg-type-icon svg{ width:26px; height:26px; }
  .qg-type-title{ font-size:12px; }

  /* ── Form fields ── */
  .qg-field{ margin-bottom:10px; }
  .qg-field > span{ font-size:12px; }
  .qg-input{ padding:10px; font-size:16px; border-radius:10px; }
  select.qg-input{ font-size:16px; }
  .qg-textarea{ font-size:16px; }
  .qg-textarea{ min-height:80px; }
  .qg-grid2{ grid-template-columns:1fr; gap:8px; }

  /* ── Repeaters ── */
  .qg-rep{ padding:10px; border-radius:12px; }
  .qg-rep-row{ gap:8px; }
  .qg-rep-row input{ flex:1 1 100%; }
  .qg-rep-row select{ flex:1 1 100%; }

  /* ── Buttons ── */
  .qg-mini{ padding:8px 10px; font-size:12px; border-radius:8px; }

  /* ── Accordion sections ── */
  .qg-disclosure{ border-radius:12px; overflow:hidden; max-width:100%; }
  .qg-disclosure > summary{ padding:14px; gap:10px; }
  .qg-disclosure[data-disc] > summary::before{ width:32px; height:32px; border-radius:10px; background-size:16px 16px; }
  .qg-disc-title{ font-size:14px; }
  .qg-disc-sub{ font-size:12px; }
  .qg-disc-body{ padding:0 14px 14px; overflow:hidden; }
  .qg-design-stack{ overflow:hidden; max-width:100%; }

  /* ── Pick cards (pattern/corner) ── */
  .qg-pickcard{ width:52px; height:52px; border-radius:10px; }
  .qg-pickicon{ width:30px; height:30px; }

  /* ── Carousels & card rows (contain width) ── */
  .qg-carousel, .qg-cardrow{ max-width:100%; min-width:0; }

  /* ── Frame carousel ── */
  .qg-frame-card{ width:74px; }
  .qg-frame-preview{ width:74px; height:74px; border-radius:10px; }
  .qg-frame-label{ font-size:10px; }

  /* ── Logo cards ── */
  .qg-logo-card{ width:48px; height:48px; border-radius:10px; }
  .qg-logo-card img{ width:24px; height:24px; }
  .qg-logo-upload-btn{ padding:12px; border-radius:12px; gap:10px; }
  .qg-logo-upload-preview{ width:38px; height:38px; border-radius:8px; }

  /* ── Color fields ── */
  .qg-colorgrid{ margin-top:24px; gap:12px; max-width:100%; }
  .qg-colorfield{ flex:1 1 100%; min-width:0; }
  .qg-colorlabel{ font-size:11px; }
  .qg-colorrow{ min-width:0; max-width:100%; }
  .qg-hex{ padding:9px 10px; font-size:16px; min-width:0; }
  .qg-color{ width:36px; height:34px; flex-shrink:0; }

  /* ── Swap buttons ── */
  .qg-swap-btn{ width:32px; height:32px; font-size:14px; border-radius:8px; }
  #qgSwapFrameColors{ padding:6px 12px; }

  /* ── Form row (frame fields) ── */
  .qg-form-row{ gap:10px; max-width:100%; overflow:hidden; }

  /* ── Result sheet ── */
  .qg-sheet{ padding:10px; }
  .qg-sheet-card{ padding:14px; border-radius:16px; }
  .qg-sheet-preview img{ width:160px; height:240px; border-radius:10px; }
  .qg-sheet-actions{ gap:8px; }

  /* ── My QRs ── */
  .qg-my-item{ flex-direction:column; align-items:stretch; gap:8px; padding:10px; }
  .qg-my-actions2{ justify-content:flex-start; }
  .qg-my-thumb{ width:44px; height:44px; }

  /* ── Analytics ── */
  .qg-ana{ padding:10px; }
  .qg-ana-grid{ grid-template-columns:1fr 1fr; gap:8px; }

  /* ── Subtitle inside accordion ── */
  .qg-subtitle{ font-size:13px; margin:4px 0 8px; }

  /* ── Section titles ── */
  .qg-section-title{ font-size:11px; }
}

/* ── Extra small screens (≤ 400px) ── */
@media(max-width:400px){
  .qg-type-grid{ grid-template-columns:1fr 1fr; gap:6px; }
  .qg-type-card{ padding:12px 6px 10px; }
  .qg-type-title{ font-size:11px; }
  .qg-type-icon{ width:30px; height:30px; }
  .qg-type-icon svg{ width:22px; height:22px; }

  .qg-wizard-footer{ justify-content:center; padding:8px 8px 10px; }
  .qg-footer-steps{ display:none; }
  .qg-wiz-btn.secondary{ flex:1; }
  .qg-wiz-btn.primary{ flex:1; }
}
