/* ============================================
   QR ID CARD — PAGE CSS v3.0
   Inherits ../style.css for shared styles.
   Card styles: DO NOT modify card-specific rules.
   Content styles: breakpoints at 600/768/1024/1280/1440/1920px
   ============================================ */

/* ── Layout overrides ── */
.card-column { max-width: 1100px !important; }
.main-layout  { max-width: 1100px !important; }

/* ══════════════════════════════════════════
   NAV FORMAT DROPDOWN
   ══════════════════════════════════════════ */
.nav-format-wrap {
  position: relative;
  display: inline-block;
}

.nav-format-btn {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  min-width: unset;
  box-shadow: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-format-btn:hover,
.nav-format-btn.open { background: rgba(255,255,255,0.30); }

.nav-format-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  min-width: 260px;
  z-index: 200;
  overflow: hidden;
  border: 1px solid #e0e7ff;
}
.nav-format-dropdown.open { display: block; }

.nav-fmt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  text-align: left;
  min-width: unset;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.12s;
}
.nav-fmt-item:last-child { border-bottom: none; }
.nav-fmt-item:hover  { background: #f3f6ff; }
.nav-fmt-item.active { background: #eef2ff; }

.fmt-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

.nav-fmt-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1a237e;
  line-height: 1.3;
}
.nav-fmt-item small {
  display: block;
  font-size: 11px;
  color: #666;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.3;
}

/* ══════════════════════════════════════════
   TEMPLATE PICKER
   ══════════════════════════════════════════ */
.tpl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
  width: 100%;
}
.tpl-label { font-size: 13px; font-weight: 700; color: #444; white-space: nowrap; }

.tpl-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid #c5cae9;
  background: #f3f4fa;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: unset;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.tpl-btn:hover { background: #e8eaf6; border-color: #3f51b5; transform: translateY(-1px); }
.tpl-btn.active {
  background: linear-gradient(135deg, #1a237e, #1565c0);
  border-color: #1a237e;
  color: #fff;
  box-shadow: 0 3px 8px rgba(26,35,126,0.28);
}

/* ══════════════════════════════════════════
   CARD WRAPPER + CARD AREA
   ══════════════════════════════════════════ */
.card-wrapper {
  padding: 10px 30px 10px 28px !important;
  overflow: visible !important;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.card-area {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 12px;
  overflow-x: visible;
  overflow-y: visible;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c5cae9 transparent;
}
.card-area::-webkit-scrollbar        { height: 6px; }
.card-area::-webkit-scrollbar-track  { background: transparent; }
.card-area::-webkit-scrollbar-thumb  { background: #c5cae9; border-radius: 3px; }

.color-picker-panel { align-self: center !important; flex-shrink: 0; justify-content: center; display: flex; flex-wrap: wrap; }

.card-area .card-wrapper,
.card-area .preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   CONTROLS ROW + CARD SIZE ROW
   ══════════════════════════════════════════ */
.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
  width: 100%;
}
.controls-row label  { font-size: 13px; font-weight: 700; color: #444; }
.controls-row input[type="range"] { cursor: pointer; accent-color: #1565c0; }
.controls-row select {
  font-size: 13px;
  border: 1.5px solid #c5cae9;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f8f9ff;
  color: #1a237e;
  cursor: pointer;
}

.card-size-row {
  order: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px !important;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
}
.card-size-row label { font-size: 13px; font-weight: 700; color: #444; white-space: nowrap; }
.card-size-row select {
  font-size: 13px !important;
  font-weight: 500;
  color: #1a237e;
  border: 1.5px solid #c5cae9;
  border-radius: 8px;
  padding: 6px 10px;
  background: #f8f9ff;
  cursor: pointer;
  outline: none;
  min-width: 260px;
  max-width: 100%;
}
.card-size-row select:focus { border-color: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,0.15); }

/* ══════════════════════════════════════════
   TOGGLE PANEL + QR OPTIONS
   ══════════════════════════════════════════ */
.toggle-panel {
  width: 100%;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
  padding: 10px 14px;
}
.toggle-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.toggle-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tog {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}
.tog input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #1565c0; }

.qr-options-panel {
  width: 100%;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
  padding: 10px 14px;
}
.qr-opts-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 6px; }
.qr-radio { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; cursor: pointer; color: #333; }
.qr-radio input[type="radio"] { accent-color: #1565c0; width: 14px; height: 14px; cursor: pointer; }

#qrCustomText {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #c5cae9;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  font-family: 'Times New Roman', Times, serif;
  margin-top: 4px;
}
#qrCustomText:focus { outline: none; border-color: #1976d2; box-shadow: 0 0 0 2px rgba(25,118,210,0.15); }

/* ══════════════════════════════════════════
   PREVIEW WRAPPER
   ══════════════════════════════════════════ */
.preview-wrapper {
  display: none !important;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: visible;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  border: 1px solid rgba(229,231,235,0.8);
  align-self: flex-start;
  width: fit-content;
}
.preview-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.live-preview-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  flex-shrink: 0;
  position: relative;
}


/* ══════════════════════════════════════════
   DOWNLOAD / BTN ROW — mobile override
   ══════════════════════════════════════════ */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  align-items: center;
}
.download-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.download-group button { flex: 1; }
.format-dropdown {
  font-size: 13px;
  border: 1.5px solid #c5cae9;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f8f9ff;
  color: #1a237e;
  cursor: pointer;
  min-width: 70px;
}

/* ══════════════════════════════════════════
   SHARE BOX — page override
   ══════════════════════════════════════════ */
.share-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
}
/* ══════════════════════════════════════════
   QR ID CARD — BASE LAYOUT
   ══════════════════════════════════════════ */
#qr-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 55%, #e8eeff 100%);
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.2;
  position: relative;
  min-width: 0;
  flex-shrink: 0;
  box-shadow: 0 6px 24px rgba(26,35,126,0.18);
}

.qrc-inner { display: flex; flex-direction: row; width: 100%; height: 100%; }
.qrc-inner.portrait { flex-direction: column; }

.qrc-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 3px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(26,35,126,0.09) 0%, rgba(26,35,126,0.03) 100%);
  border-right: 2px solid rgba(26,35,126,0.12);
  overflow: hidden;
  box-sizing: border-box;
}

.qrc-inner.portrait .qrc-left {
  flex-direction: column;
  align-items: center;
  border-right: none;
  border-bottom: 1px solid rgba(26,35,126,0.12);
  width: 100% !important;
  padding: 8px 10px;
  height: auto;
  justify-content: flex-start;
  gap: 6px;
  overflow: hidden;
}

.qrc-org {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
.qrc-inner.portrait .qrc-org {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.qrc-inner.portrait .qrc-photo-box { flex-shrink: 0; }
.qrc-inner.portrait .qrc-qr-wrap   { flex-direction: column; align-items: center; width: auto; }
.qrc-inner.portrait .qrc-left .photo-qr-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

#logo-preview {
  width: 26px; height: 26px;
  object-fit: contain; display: none;
  border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(26,35,126,0.2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.logo-placeholder {
  font-size: 8px; color: #1976d2; cursor: pointer;
  border: 1px dashed #1976d2; padding: 1px 3px; border-radius: 3px;
  white-space: nowrap; display: inline-block;
}

#orgName {
  font-weight: 800; font-size: 9px; color: #1a237e;
  text-align: center; width: 100%; max-width: 100%;
  line-height: 1.1; font-family: Georgia, serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  word-break: normal; letter-spacing: 0.2px;
}

.qrc-photo-box {
  border: 2px solid rgba(26,35,126,0.25);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  cursor: pointer; overflow: hidden; flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(26,35,126,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.qrc-photo-box:hover { border-color: #1976d2; box-shadow: 0 3px 10px rgba(25,118,210,0.25); }
#photo-preview { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-placeholder { font-size: 10px; color: #94a3b8; font-weight: 600; pointer-events: none; text-align: center; }

.qrc-qr-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex-shrink: 0; overflow: hidden;
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.75); border-radius: 6px; padding: 3px;
}
#qrCanvas { overflow: hidden; display: block; flex-shrink: 0; }
#qrCanvas img, #qrCanvas canvas { display: block !important; max-width: none !important; max-height: none !important; }
.qr-label { font-size: 7px; color: #475569; letter-spacing: 0.8px; font-weight: 700; text-transform: uppercase; text-align: center; line-height: 1; }

.qrc-right {
  flex: 1; display: flex; flex-direction: column;
  padding: 7px 9px; overflow: hidden; gap: 2px; min-width: 0;
}
.qrc-inner.portrait .qrc-right { width: 100% !important; padding: 6px 10px; flex: 1; min-height: 0; }

.qrc-title-bar {
  width: 100%; text-align: center; font-weight: 900; letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(90deg, #1a237e 0%, #1565c0 60%, #1976d2 100%);
  border-radius: 5px; padding: 4px 6px; margin-bottom: 4px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26,35,126,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  outline: none; cursor: text;
}
/* Title bar is contenteditable — override generic dashed border; keep blue bg on hover/focus */
#cardTitleBar { border-bottom: none !important; padding-bottom: 4px; }
#cardTitleBar:hover  { background: linear-gradient(90deg,#1a237e 0%,#1565c0 60%,#1976d2 100%) !important; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
#cardTitleBar:focus  { background: linear-gradient(90deg,#1a237e 0%,#1565c0 60%,#1976d2 100%) !important; box-shadow: 0 0 0 2px rgba(255,255,255,0.55); outline: none; }
#cardTitleBar.empty::before { color: rgba(255,255,255,0.45) !important; }

.qrc-name-row { font-weight: 800; font-style: normal; color: #1a237e; word-break: break-word; margin-bottom: 2px; flex-shrink: 0; }
#nameOut { font-family: Georgia, serif; font-weight: 700; font-style: normal; }

.qrc-field { display: flex; align-items: baseline; gap: 3px; word-break: break-word; flex-shrink: 0; line-height: 1.3; }
.qrc-field-lbl { font-weight: 800; color: #1a237e; white-space: nowrap; flex-shrink: 0; }

.qrc-sign-wrap { display: flex; flex-direction: column; align-items: flex-start; margin-top: auto; padding-top: 3px; flex-shrink: 0; }
.qrc-sign-box {
  width: 66px; height: 24px;
  border-top: 1.5px solid #1a237e;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
  background: rgba(255,255,255,0.6);
}
.qrc-sign-box:hover { border-top-color: #1976d2; background: #e8f0fe; }
#signature-preview { max-width: 100%; max-height: 100%; object-fit: contain; display: none; }
.qrc-sign-lbl { font-size: 8px; color: #64748b; margin-top: 1px; font-weight: 700; letter-spacing: 0.3px; }

/* ── contenteditable ── */
#qr-card [contenteditable="true"] {
  outline: none; cursor: text; min-width: 16px; display: inline;
  white-space: normal; word-break: break-word;
  border-bottom: 1px dashed #93c5fd; border-radius: 2px; padding-bottom: 1px;
  transition: border-color 0.2s, background 0.2s;
}
#qr-card [contenteditable="true"]:hover  { border-bottom-color: #1976d2; background: rgba(25,118,210,0.05); }
#qr-card [contenteditable="true"]:focus  { border-bottom: 1.5px solid #1976d2; background: rgba(25,118,210,0.07); }
#qr-card [contenteditable="true"].empty::before { content: attr(data-placeholder); color: #bbb !important; font-weight: 400 !important; font-style: italic; font-size: inherit; pointer-events: none; }
#qr-card [contenteditable="false"].empty::before,
#qr-card [contenteditable="false"] .empty::before,
#qr-card .no-placeholder::before               { display: none !important; content: none !important; }
#qr-card [contenteditable="false"] { border-bottom: none !important; background: transparent !important; }

/* ── × buttons ── */
.outside-clear {
  position: absolute; width: 18px; height: 18px;
  background: #ef4444; color: #fff; border-radius: 50%;
  font-size: 12px; font-weight: 700; line-height: 18px;
  text-align: center; cursor: pointer; user-select: none; z-index: 20;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
  transition: background 0.15s, transform 0.1s;
}
.outside-clear:hover { background: #dc2626; transform: scale(1.1); }

/* ══════════════════════════════════════════
   STUDENT FORMAT
   ══════════════════════════════════════════ */
#qr-card.fmt-student {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 55%, #dbeafe 100%);
  box-shadow: 0 6px 24px rgba(21,101,192,0.2);
}
#qr-card.fmt-student .qrc-inner  { flex-direction: column; }
#qr-card.fmt-student .qrc-left {
  flex-direction: column; align-items: center;
  justify-content: flex-start; border-right: none;
  border-bottom: 2px solid rgba(21,101,192,0.15);
  width: 100%; height: auto;
  flex-shrink: 0; overflow: hidden;
  padding: 6px 10px 8px; gap: 5px;
  background: linear-gradient(180deg, rgba(21,101,192,0.09) 0%, rgba(21,101,192,0.02) 100%);
}
#qr-card.fmt-student .qrc-org {
  flex-direction: row; justify-content: center;
  align-items: center; gap: 8px; width: 100%;
}
#qr-card.fmt-student #orgName { color: #1565c0; font-size: 11px; }
#qr-card.fmt-student .qrc-photo-box {
  border-radius: 50%; border: 3px solid #1565c0;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 3px 14px rgba(21,101,192,0.28);
  flex-shrink: 0;
}
#qr-card.fmt-student .qrc-qr-wrap {
  background: rgba(255,255,255,0.85);
  border-radius: 8px; padding: 4px;
  flex-direction: column; align-items: center;
  width: auto; flex-shrink: 0;
}
#qr-card.fmt-student .qrc-right {
  width: 100%; padding: 5px 14px 8px;
  align-items: center; text-align: center;
  flex: 1; min-height: 0; overflow: hidden;
}
#qr-card.fmt-student .qrc-title-bar {
  background: linear-gradient(90deg, #1565c0 0%, #1976d2 60%, #1e88e5 100%);
  box-shadow: 0 2px 8px rgba(21,101,192,0.3); letter-spacing: 2.5px;
}
#qr-card.fmt-student .qrc-name-row { text-align: center; color: #1565c0; }
#qr-card.fmt-student .qrc-field    { justify-content: center; }
#qr-card.fmt-student .qrc-field-lbl { color: #1565c0; }

/* ══════════════════════════════════════════
   CORPORATE FORMAT
   ══════════════════════════════════════════ */
#qr-card.fmt-corporate {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 55%, #dcfce7 100%);
  box-shadow: 0 6px 24px rgba(27,94,32,0.18);
}
#qr-card.fmt-corporate .qrc-left {
  background: linear-gradient(180deg, rgba(27,94,32,0.09) 0%, rgba(27,94,32,0.03) 100%);
  border-right-color: rgba(27,94,32,0.15);
}
#qr-card.fmt-corporate .qrc-title-bar {
  background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 60%, #388e3c 100%);
  box-shadow: 0 2px 8px rgba(27,94,32,0.35);
}
#qr-card.fmt-corporate .qrc-field-lbl { color: #1b5e20; }
#qr-card.fmt-corporate .qrc-name-row  { color: #0f2d12; }
#qr-card.fmt-corporate .qrc-photo-box {
  border-color: rgba(27,94,32,0.3);
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
#qr-card.fmt-corporate #orgName      { color: #1b5e20; }
#qr-card.fmt-corporate .qrc-sign-box { border-top-color: #1b5e20; }

/* ══════════════════════════════════════════
   VISITOR FORMAT
   ══════════════════════════════════════════ */
#qr-card.fmt-visitor {
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 55%, #ffe4e4 100%);
  box-shadow: 0 6px 24px rgba(183,28,28,0.18);
}
#qr-card.fmt-visitor .qrc-inner  { flex-direction: row; }
#qr-card.fmt-visitor .qrc-left {
  background: linear-gradient(180deg, rgba(183,28,28,0.08) 0%, rgba(183,28,28,0.02) 100%);
  border-right-color: rgba(183,28,28,0.15);
  justify-content: flex-start; gap: 8px; padding: 8px 6px;
}
#qr-card.fmt-visitor .qrc-title-bar {
  background: linear-gradient(90deg, #b71c1c 0%, #c62828 60%, #d32f2f 100%);
  box-shadow: 0 2px 8px rgba(183,28,28,0.35);
}
#qr-card.fmt-visitor .qrc-right  { border-right: 1px solid rgba(183,28,28,0.12); }
#qr-card.fmt-visitor .qrc-field-lbl { color: #b71c1c; }
#qr-card.fmt-visitor .qrc-name-row  { color: #2d0f0f; }
#qr-card.fmt-visitor .qrc-photo-box {
  border-color: rgba(183,28,28,0.3);
  background: linear-gradient(135deg, #fff5f5, #ffe4e4);
}
#qr-card.fmt-visitor #orgName      { color: #b71c1c; }
#qr-card.fmt-visitor .qrc-sign-box { border-top-color: #b71c1c; }

/* ══════════════════════════════════════════
   PREVIEW CLONE — suppress interactivity
   ══════════════════════════════════════════ */
#livePreview #qr-card                  { pointer-events: none; user-select: none; cursor: default; }
#livePreview #qr-card [contenteditable]{ border-bottom: none !important; background: transparent !important; cursor: default; }
/* Title bar has its own gradient — must not be transparent in preview (clone sets CE=false) */
#livePreview #qr-card .qrc-title-bar              { background: linear-gradient(90deg,#1a237e 0%,#1565c0 60%,#1976d2 100%) !important; box-shadow: 0 2px 8px rgba(26,35,126,0.3) !important; }
#livePreview #qr-card.fmt-student   .qrc-title-bar{ background: linear-gradient(90deg,#1565c0 0%,#1976d2 60%,#1e88e5 100%) !important; box-shadow: 0 2px 8px rgba(21,101,192,0.3) !important; }
#livePreview #qr-card.fmt-corporate .qrc-title-bar{ background: linear-gradient(90deg,#1b5e20 0%,#2e7d32 60%,#388e3c 100%) !important; box-shadow: 0 2px 8px rgba(27,94,32,0.35) !important; }
#livePreview #qr-card.fmt-visitor   .qrc-title-bar{ background: linear-gradient(90deg,#b71c1c 0%,#c62828 60%,#d32f2f 100%) !important; box-shadow: 0 2px 8px rgba(183,28,28,0.35) !important; }
#livePreview #qr-card .empty::before   { display: none !important; }
#livePreview #qr-card .outside-clear   { display: none !important; }
#livePreview #qr-card .logo-placeholder,
#livePreview #qr-card .photo-placeholder,
#livePreview #qr-card .sign-placeholder{ visibility: hidden !important; }

/* ══════════════════════════════════════════
   INLINE LINKS
   ══════════════════════════════════════════ */
.inline-link { color: #1d4ed8; text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

/* ── Mobile scroll hint — shows below card when overflowing ── */
@media (max-width: 640px) {
  .card-wrapper::after {
    content: '← scroll to see full card →';
    display: block;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    padding: 2px 0 0;
    letter-spacing: 0.2px;
    pointer-events: none;
  }
}

/* ══════════════════════════════════════════
   TOOL HERO IMAGE — below QR options panel
   ══════════════════════════════════════════ */
.tool-hero-img-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(26,35,126,0.12);
  background: transparent;
  margin-top: 4px;
  /* Collapse wrapper if image fails to load */
  min-height: 0;
  line-height: 0;
  font-size: 0;
}
.tool-hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border-radius: 12px;
  object-fit: cover;
  min-height: 0;
}

/* Responsive sizing */
@media (max-width: 600px) {
  .tool-hero-img-wrap {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(26,35,126,0.10);
  }
  .tool-hero-img { border-radius: 8px; }
}
@media (min-width: 1280px) {
  .tool-hero-img-wrap { box-shadow: 0 6px 22px rgba(26,35,126,0.14); }
}
/* ══════════════════════════════════════════
   CONTENT SECTIONS — font sizes + breakpoints
   Mobile-first: 600 / 768 / 1024 / 1280 / 1440 / 1920px
   ══════════════════════════════════════════ */

/* ── Default (< 600px) ── */
h1                            { font-size: 21px !important; line-height: 1.25 !important; }
.para h2, .questions h2       { font-size: 18px !important; font-weight: 700 !important; color: #111827 !important; margin: 0 0 10px !important; line-height: 1.3 !important; }
.para h3       { font-size: 15px !important; font-weight: 700 !important; color: #111827 !important; margin: 0 0 6px !important; }
.para p, .tool-notice p,
.how-to-list li, .content-list li,
.questions dt                 { font-size: 14px !important; font-weight: 700 !important; color: #111827 !important; }
.questions dd                 { font-size: 13.5px !important; color: #374151 !important; line-height: 1.7 !important; margin: 0 0 2px !important; }
.size-table th, .size-table td{ font-size: 13px !important; }

@media (min-width: 600px) {
  h1                            { font-size: 23px !important; }
  .para h2, .questions h2       { font-size: 20px !important; }
  .para h3       { font-size: 16px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 14.5px !important; }
  .questions dd                 { font-size: 14px !important; }
  .size-table th,.size-table td { font-size: 13.5px !important; }
  .card-size-row select         { min-width: 200px; }
  .tpl-btn      { font-size: 13px; }
  .tpl-label    { font-size: 13px; }
  .tog          { font-size: 13px; }
  .qr-radio     { font-size: 13px; }
  .toggle-panel-title { font-size: 13px; }

  .controls-row label { font-size: 13px; }
  .card-size-row label { font-size: 13px; }
  .section-chip { font-size: .73rem; }
  .last-updated { font-size: 13px !important; }
  .trust-bar { font-size: .84rem; }
  .trust-item { font-size: .84rem; }
}

@media (min-width: 768px) {
  h1                            { font-size: 25px !important; }
  .para h2, .questions h2       { font-size: 21px !important; }
  .para h3       { font-size: 17px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 15px !important; }
  .questions dd                 { font-size: 14.5px !important; }
  .size-table th,.size-table td { font-size: 14px !important; }
  .tpl-btn      { font-size: 13.5px; }
  .tpl-label    { font-size: 13.5px; }
  .tog          { font-size: 13.5px; }
  .qr-radio     { font-size: 13.5px; }
  .controls-row label { font-size: 13.5px; }
  .card-size-row label { font-size: 13.5px; }

  .section-chip { font-size: .74rem; }
  .last-updated { font-size: 13px !important; }
  .trust-bar { font-size: .85rem; }
  .trust-item { font-size: .85rem; }
}

@media (min-width: 1024px) {
  h1                            { font-size: 27px !important; }
  .para h2, .questions h2       { font-size: 22px !important; }
  .para h3       { font-size: 17.5px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 15.5px !important; }
  .questions dd                 { font-size: 15px !important; }
  .size-table th,.size-table td { font-size: 14.5px !important; }
  .tpl-btn      { font-size: 14px; }
  .tpl-label    { font-size: 14px; }
  .tog          { font-size: 14px; }
  .qr-radio     { font-size: 14px; }
  .controls-row label { font-size: 14px; }
  .card-size-row label { font-size: 14px; }
  .toggle-panel-title { font-size: 14px; }

  .section-chip { font-size: .75rem; }
  .last-updated { font-size: 13.5px !important; }
  .trust-bar { font-size: .86rem; }
  .trust-item { font-size: .86rem; }
}

@media (min-width: 1280px) {
  h1                            { font-size: 29px !important; }
  .para h2, .questions h2       { font-size: 23px !important; }
  .para h3       { font-size: 18px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 16px !important; }
  .questions dd                 { font-size: 15.5px !important; }
  .size-table th,.size-table td { font-size: 15px !important; }

  .tpl-btn { font-size: 14.5px; }
  .tpl-label { font-size: 14.5px; }
  .tog { font-size: 14.5px; }
  .qr-radio { font-size: 14.5px; }
  .controls-row label { font-size: 14.5px; }
  .card-size-row label { font-size: 14.5px; }
  .section-chip { font-size: .76rem; }
  .last-updated { font-size: 14px !important; }
  .trust-bar { font-size: .88rem; }
  .trust-item { font-size: .88rem; }
}

@media (min-width: 1440px) {
  h1                            { font-size: 31px !important; }
  .para h2, .questions h2       { font-size: 24px !important; }
  .para h3       { font-size: 19px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 16.5px !important; }
  .questions dd                 { font-size: 16px !important; }
  .size-table th,.size-table td { font-size: 15.5px !important; }

  .tpl-btn { font-size: 15px; }
  .tpl-label { font-size: 15px; }
  .tog { font-size: 15px; }
  .qr-radio { font-size: 15px; }
  .controls-row label { font-size: 15px; }
  .card-size-row label { font-size: 15px; }
  .section-chip { font-size: .78rem; }
  .last-updated { font-size: 14.5px !important; }
  .trust-bar { font-size: .9rem; }
  .trust-item { font-size: .9rem; }
}

@media (min-width: 1920px) {
  h1                            { font-size: 33px !important; }
  .para h2, .questions h2       { font-size: 26px !important; }
  .para h3       { font-size: 20px !important; }
  .para p, .tool-notice p,
  .how-to-list li,.content-list li,
  .questions dt                 { font-size: 17.5px !important; }
  .questions dd                 { font-size: 16.5px !important; }
  .size-table th,.size-table td { font-size: 16px !important; }

  .tpl-btn { font-size: 16px; }
  .tpl-label { font-size: 16px; }
  .tog { font-size: 16px; }
  .qr-radio { font-size: 16px; }
  .controls-row label { font-size: 16px; }
  .card-size-row label { font-size: 16px; }
  .section-chip { font-size: .81rem; }
  .last-updated { font-size: 15px !important; }
  .trust-bar { font-size: .93rem; }
  .trust-item { font-size: .93rem; }
}

/* Small screen control fixes */
@media (max-width: 400px) {
  /* Do NOT override padding-left — 28px is needed for × button position */
  .card-area {
    overflow-x: auto !important;
  }
  /* Force × button to stay visible at left edge */
  .outside-clear {
    left: 4px !important;
  }
}

/* ── × button — ensure visible on mobile ── */
@media (max-width: 640px) {
  .outside-clear {
    min-width: 22px !important;
    width: 22px !important;
    min-height: 22px !important;
    height: 22px !important;
    font-size: 13px !important;
    line-height: 22px !important;
    box-shadow: 0 2px 10px rgba(239,68,68,0.7) !important;
  }
  /* Card scroll container — visible scrollbar right under the card */
  .card-wrapper {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-right: 30px !important;
    /* Always-visible styled scrollbar for mobile */
    scrollbar-width: auto !important;
    scrollbar-color: #1565c0 #dbeafe !important;
    padding-bottom: 4px !important;
  }
  .card-wrapper::-webkit-scrollbar {
    height: 8px !important;
    display: block !important;
  }
  .card-wrapper::-webkit-scrollbar-track {
    background: #dbeafe !important;
    border-radius: 4px !important;
    margin: 0 4px !important;
  }
  .card-wrapper::-webkit-scrollbar-thumb {
    background: #1565c0 !important;
    border-radius: 4px !important;
    min-width: 40px !important;
  }
  .card-wrapper::-webkit-scrollbar-thumb:hover {
    background: #1a237e !important;
  }
  /* Inside card-area (column on mobile): card first → color dots → preview */
  .card-area .card-wrapper      { order: 1; }
  .card-area .color-picker-panel{ order: 2; }
  .card-area .preview-wrapper   { order: 3; display: flex !important; }
}

@media (max-width: 375px) {
  .tpl-btn       { font-size: 11px; padding: 5px 7px; }
  .tpl-label     { font-size: 11px; }
  .tog           { font-size: 11px; }
  .qr-radio      { font-size: 11px; }
  .nav-format-btn{ font-size: 11px; padding: 5px 10px; }
  .nav-format-dropdown { min-width: 220px; }
}
@media (max-width: 599px) {
  .qr-opts-row   { gap: 6px 10px; }
  .controls-row  { gap: 10px; }
}

/* ══════════════════════════════════════════
   PAGE-SPECIFIC UI — moved from inline <style>
   (sticky CTA, trust bar, size table, section chips,
    para sections, lists, FAQ, questions, tool-notice)
   ══════════════════════════════════════════ */

/* ── Sticky CTA ── */
.sticky-cta{position:fixed;bottom:22px;right:22px;z-index:999;opacity:0;pointer-events:none;transition:opacity .3s,transform .3s;transform:translateY(6px);}
.sticky-cta.visible{opacity:1;pointer-events:auto;transform:translateY(0);}
.sticky-cta-btn{display:inline-flex;align-items:center;gap:6px;background:linear-gradient(135deg,#1a73e8,#1251aa);color:#fff;padding:11px 20px;border-radius:28px;font-size:.88rem;font-weight:700;text-decoration:none;box-shadow:0 4px 14px rgba(26,115,232,.4);letter-spacing:.2px;}
.sticky-cta-btn:hover{background:linear-gradient(135deg,#1557b0,#0d3f8a);box-shadow:0 6px 18px rgba(26,115,232,.5);}

/* ── Trust bar ── */
.trust-bar{display:flex;flex-wrap:wrap;gap:5px 16px;justify-content:center;align-items:center;background:linear-gradient(135deg,#f0f7ff,#e8f0fe);border:1px solid #c5dcf7;border-radius:10px;padding:11px 18px;margin:10px auto 18px;max-width:800px;font-size:.83rem;font-weight:600;color:#1a4a7a;}
.trust-sep{color:#93c5d4;font-weight:300;}
.trust-item{display:inline-flex;align-items:center;gap:4px;}

/* ── Size comparison table ── */
.size-table-wrap{overflow-x:auto;margin:14px 0;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.07);}
.size-table{width:100%;border-collapse:collapse;font-size:.87rem;}
.size-table thead tr{background:linear-gradient(90deg,#1a237e,#1565c0);}
.size-table th{color:#fff;padding:10px 14px;text-align:left;white-space:nowrap;font-weight:700;letter-spacing:.3px;}
.size-table th:first-child{border-radius:10px 0 0 0;}
.size-table th:last-child{border-radius:0 10px 0 0;}
.size-table td{padding:8px 14px;border-bottom:1px solid #e8edf5;vertical-align:top;color:#1f2937;}
.size-table tbody tr:nth-child(even) td{background:#f5f8ff;}
.size-table tbody tr:last-child td{border-bottom:none;}
.size-table tbody tr:hover td{background:#eef2ff;}

/* ── Section label chips ── */
.section-chip{display:inline-block;background:linear-gradient(135deg,#e8f0fe,#dbeafe);color:#1a237e;font-size:.72rem;font-weight:800;letter-spacing:.8px;text-transform:uppercase;padding:3px 10px;border-radius:20px;margin-bottom:8px;border:1px solid #c5d8f7;}
.last-updated{font-size:13px !important;color:#94a3b8;margin:0 0 12px;padding:0 2px;}

/* ── Para sections ── */
.para{padding:22px 24px !important;margin-bottom:14px !important;border-radius:14px !important;background:#fff !important;border:1px solid #edf0f7 !important;box-shadow:0 2px 8px rgba(26,35,126,.05) !important;}
.para:nth-child(even){background:#fafbff !important;}
.para h2{border-bottom:2px solid #e8edf5;padding-bottom:8px;margin-bottom:14px !important;}

/* ── How-to steps ── */
.how-to-list{padding-left:0 !important;list-style:none !important;counter-reset:step;margin:14px 0 !important;}
.how-to-list li{counter-increment:step;display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-bottom:1px solid #f0f2f8;}
.how-to-list li:last-child{border-bottom:none;}
.how-to-list li::before{content:counter(step);display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;background:linear-gradient(135deg,#1a237e,#1565c0);color:#fff;border-radius:50%;font-size:.78rem;font-weight:800;flex-shrink:0;margin-top:2px;}

/* ── Content list ── */
.content-list{padding-left:0 !important;list-style:none !important;margin:12px 0 !important;}
.content-list li{padding:9px 0 9px 18px;border-bottom:1px solid #f0f2f8;position:relative;line-height:1.65 !important;}
.content-list li:last-child{border-bottom:none;}
.content-list li::before{content:"";position:absolute;left:0;top:17px;width:6px;height:6px;background:#1565c0;border-radius:50%;}

/* ── Tool notice ── */
.tool-notice{background:linear-gradient(135deg,#eef2ff,#e8f0fe);border:1px solid #c7d7f7;border-radius:10px;padding:16px 20px;line-height:1.7;color:#1f2937;}
.tool-notice p{margin:0 0 10px !important;}
.tool-notice p:last-child{margin-bottom:0 !important;}

/* ── Questions / FAQ section ── */
.questions{background:linear-gradient(135deg,#f8faff,#eef2ff);border:1px solid #dde6f7;border-radius:14px;padding:22px 24px;margin-bottom:14px;}
.questions h2{color:#1a237e !important;border-bottom:2px solid #dde6f7;padding-bottom:8px;margin-bottom:16px !important;}
.questions dl{margin:0;}
.questions dt{padding:12px 0 4px;border-top:1px solid #e8edf5;font-weight:700;color:#111827;}
.questions dt:first-of-type{border-top:none;padding-top:0;}
.questions dd{margin:0 0 4px;padding-bottom:10px;color:#374151;line-height:1.7;}

/* ── Mobile overrides ── */
@media(max-width:600px){
  .card-column{padding-bottom:80px !important;display:flex;flex-direction:column;}
  /* Reorder: template → card → font controls → fields → size → download */
  .tpl-row       { order: 1; }
  .card-area     { order: 2; }
  .controls-row  { order: 3; }
  .toggle-panel  { order: 4; }
  .card-size-row { order: 5; }
  .btn-row       { order: 6; }
  .share-box     { order: 7; }
  .qr-options-panel { order: 8; }
  .tool-hero-img-wrap { order: 9; }
  .trust-sep{display:none;}
  .trust-bar{flex-direction:column;gap:5px;text-align:center;}
  .sticky-cta-btn{font-size:.81rem;padding:9px 16px;}
  .para{padding:16px !important;}
  .questions{padding:16px;}
  .size-table{font-size:.8rem;}
  .size-table th,.size-table td{padding:7px 10px;}
  /* Mobile tool UI */
  .tpl-btn{font-size:12px;padding:5px 10px;}
  .tpl-label{font-size:12px;}
  .tpl-row{gap:6px;padding:8px;}
  .controls-row{flex-direction:column;align-items:flex-start;gap:8px;padding:10px;}
  .controls-row > div{width:100%;display:flex;align-items:center;gap:8px;}
  .controls-row select{width:100%;font-size:13px;}
  .controls-row input[type="range"]{flex:1;}
  .toggle-grid{gap:6px 10px;}
  .tog{font-size:12px;}
  .qr-radio{font-size:12px;}
  .card-size-row{flex-direction:column;align-items:flex-start;gap:6px;}
  .card-size-row select{min-width:unset;width:100%;}
  .btn-row{flex-wrap:wrap;gap:8px;}
  .btn-row button{flex:1;min-width:120px;}
  .download-group{flex:1;display:flex;gap:6px;}
  .download-group button{flex:1;}
  .download-group select{min-width:70px;}
  .share-box{justify-content:center;}
  #qrCustomText{font-size:13px;}
  .qr-opts-row{flex-direction:column;gap:8px;}
  #qr-card{font-size:clamp(7px,2.2vw,11px);}
}

/* ── 640px: show preview beside card ── */
@media(min-width:640px){
  .card-area{
    flex-direction:row !important;
    align-items:flex-start !important;
    overflow-x:auto;
  }
  /* Restore natural order on desktop */
  .card-area .card-wrapper      { order: unset; }
  .card-area .color-picker-panel{ order: unset; }
  .card-area .preview-wrapper   { order: unset; display: flex !important; }
  .tool-hero-img-wrap           { order: unset; }
  .card-wrapper{padding:15px 15px 15px 30px !important;width:auto;}
}

/* ── 480px: slightly bigger UI text ── */
@media(min-width:480px) and (max-width:639px){
  .tpl-btn{font-size:12.5px;padding:5px 12px;}
  .tog{font-size:12.5px;}
  .qr-radio{font-size:12.5px;}
}

/* ════════════════════════════════════════════════════
   NEW CONTENT ELEMENTS — added for AdSense content depth
   ════════════════════════════════════════════════════ */

/* Intro wrap above tool */
.qr-intro-wrap {
  background: #f0f4ff;
  border: 1px solid #dde4ff;
  border-radius: 14px;
  padding: 14px 16px 12px;
  margin: 0 auto 12px;
  max-width: 960px;
}
.qr-intro-lead {
  font-size: 0.88rem;
  color: #1a237e;
  margin: 0 0 8px;
  line-height: 1.65;
  font-weight: 500;
}
.qr-intro-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.75;
  color: #2d3748;
}
.qr-intro-steps li { margin-bottom: 3px; }

/* Use-case grid below tool */
.qr-use-strip { max-width: 960px; margin: 0 auto 4px; }
.qr-use-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.qr-use-card {
  background: #fff;
  border: 1px solid #e8eaf6;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ── Responsive font scaling for new elements ── */
@media (max-width: 480px) {
  .qr-use-cards        { grid-template-columns: 1fr 1fr; }
  .qr-intro-wrap       { padding: 11px 12px 10px; }
  .qr-intro-lead       { font-size: 0.84rem; }
  .qr-intro-steps      { font-size: 0.82rem; }
  .qr-use-card         { font-size: 0.81rem; padding: 9px 10px; }
}
@media (min-width: 600px) {
  .qr-intro-lead       { font-size: 0.92rem; }
  .qr-intro-steps      { font-size: 0.90rem; }
  .qr-use-card         { font-size: 0.87rem; }
  .qr-intro-wrap       { padding: 16px 20px 14px; }
}
@media (min-width: 768px) {
  .qr-intro-lead       { font-size: 0.96rem; }
  .qr-intro-steps      { font-size: 0.93rem; }
  .qr-use-card         { font-size: 0.89rem; }
}
@media (min-width: 1024px) {
  .qr-intro-lead       { font-size: 1.00rem; }
  .qr-intro-steps      { font-size: 0.95rem; }
  .qr-use-card         { font-size: 0.91rem; }
}
@media (min-width: 1280px) {
  .qr-intro-lead       { font-size: 1.03rem; }
  .qr-intro-steps      { font-size: 0.97rem; }
  .qr-use-card         { font-size: 0.93rem; }
}
@media (min-width: 1440px) {
  .qr-intro-lead       { font-size: 1.06rem; }
  .qr-intro-steps      { font-size: 0.99rem; }
  .qr-use-card         { font-size: 0.95rem; }
}
@media (min-width: 1920px) {
  .qr-intro-lead       { font-size: 1.10rem; }
  .qr-intro-steps      { font-size: 1.02rem; }
  .qr-use-card         { font-size: 0.98rem; }
}
