/* ═══════════════════════════════════════════════════════════════════════════
   Quick-Fill Panel v6 — Premium Design System
   Stripe / Vercel / Notion aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Panel container ────────────────────────────────────────────────────── */
#quickFillPanel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  bottom: calc(var(--input-bottom, 80px) + 14px);
  width: min(1060px, 94vw);
  max-height: calc(100dvh - var(--input-bottom, 80px) - 40px);
  z-index: 120;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  will-change: opacity, transform;
  contain: layout style;
}
#quickFillPanel.qfp-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* ── Glass container ────────────────────────────────────────────────────── */
.qfp-glass {
  background: rgba(8, 8, 12, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  box-shadow: 0 16px 48px -8px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
}

/* ── Loading bar ─────────────────────────────────────────────────────────── */
.qfp-loading-bar {
  height: 1.5px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, transparent, #F4EB33, transparent);
  background-size: 200% 100%;
  animation: qfp-shimmer 1.2s infinite;
  display: none;
}
.qfp-loading-bar.visible { display: block; }
@keyframes qfp-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Header ─────────────────────────────────────────────────────────────── */
.qfp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.qfp-header-info { display: flex; flex-direction: column; gap: 4px; }
.qfp-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 300;
  color: rgba(255,255,255,0.94);
  letter-spacing: 0.02em;
}
.qfp-icon { font-size: 18px; }
.qfp-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  margin-top: 0;
  letter-spacing: 0.01em;
  line-height: 1.5;
  font-weight: 300;
}
.qfp-close {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  color: rgba(255,255,255,0.32);
  width: 32px; height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.qfp-close:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.14); }

/* ── Body ────────────────────────────────────────────────────────────────── */
.qfp-body {
  padding: 24px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}
.qfp-body::-webkit-scrollbar       { width: 4px; }
.qfp-body::-webkit-scrollbar-track { background: transparent; }
.qfp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* ── Section system ─────────────────────────────────────────────────────── */
.qfp-section { margin-bottom: 24px; }
.qfp-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.qfp-section-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.qfp-section-icon.accent   { background: rgba(244,235,51,0.08); border-color: rgba(244,235,51,0.18); }
.qfp-section-icon.identity { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.18); }
.qfp-section-meta { display: flex; flex-direction: column; gap: 2px; }
.qfp-section-title {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.qfp-section-desc { font-size: 11px; color: rgba(255,255,255,0.28); letter-spacing: 0.01em; }

/* ── Row / col ───────────────────────────────────────────────────────────── */
.qfp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.qfp-col { display: flex; flex-direction: column; gap: 8px; }
.qfp-col--full { grid-column: 1 / -1; }

/* ── Compact setup grid ──────────────────────────────────────────────────── */
.qfp-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) { .qfp-setup-grid { grid-template-columns: 1fr; } }

.qfp-setup-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}
.qfp-setup-field:focus-within { border-color: rgba(255,255,255,0.14); }

/* ── Label ────────────────────────────────────────────────────────────────── */
.qfp-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  flex-wrap: wrap;
}
.qfp-label-badge {
  font-size: 9px;
  background: rgba(244,235,51,0.10); color: rgba(244,235,51,0.85);
  border: 1px solid rgba(244,235,51,0.18);
  border-radius: 5px; padding: 2px 7px;
  letter-spacing: 0.04em; text-transform: lowercase;
  font-weight: 500;
}
.qfp-label-badge.opt {
  background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.07);
}

/* ── Variable header ─────────────────────────────────────────────────────── */
.qfp-var-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

/* ── Toggle pill ─────────────────────────────────────────────────────────── */
.qfp-toggle {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.qfp-toggle-btn {
  background: transparent; border: none;
  border-radius: 8px; font-size: 11px; font-family: inherit;
  color: rgba(255,255,255,0.34); padding: 5px 14px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  white-space: nowrap; letter-spacing: 0.02em;
  font-weight: 400;
}
.qfp-toggle-btn:hover { color: rgba(255,255,255,0.6); }
.qfp-toggle-btn.active {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.90);
  font-weight: 500;
}
.qfp-toggle-btn:last-child.active {
  background: rgba(244,235,51,0.10);
  color: #F4EB33;
}

/* ── Field group ─────────────────────────────────────────────────────────── */
.qfp-field-group { position: relative; }

/* ── Input wrap ──────────────────────────────────────────────────────────── */
.qfp-input-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px; min-height: 42px; overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.qfp-input-wrap:focus-within {
  border-color: rgba(244,235,51,0.35);
  background: rgba(255,255,255,0.05);
}
.qfp-input-wrap:has(.qfp-inbar-chip) {
  border-color: rgba(16,185,129,0.28);
  background: rgba(16,185,129,0.04);
}

.qfp-convention-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; font-size: 11px; color: rgba(255,255,255,0.35); margin-bottom: 2px;
}
.qfp-convention-icon { font-size: 12px; flex-shrink: 0; }

.qfp-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: rgba(255,255,255,0.92); font-size: 13px; font-family: inherit;
  padding: 10px 32px 10px 14px;
  letter-spacing: 0.01em;
}
.qfp-input::placeholder { color: rgba(255,255,255,0.18); }
.qfp-input.qfp-error { color: #ef4444; }

.qfp-search-icon {
  position: absolute; right: 12px;
  color: rgba(255,255,255,0.15); font-size: 15px; pointer-events: none;
}

/* ── In-bar clear ────────────────────────────────────────────────────────── */
.qfp-inbar-clear {
  flex-shrink: 0; background: transparent; border: none;
  color: rgba(255,255,255,0.28); font-size: 17px; line-height: 1;
  padding: 0 12px 0 4px; cursor: pointer;
  display: flex; align-items: center; transition: color 0.15s;
}
.qfp-inbar-clear:hover { color: rgba(255,255,255,0.8); }

/* ── Selection chip ──────────────────────────────────────────────────────── */
.qfp-inbar-chip {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 14px; overflow: hidden;
}
.qfp-inbar-chip-check  { font-size: 11px; color: #10b981; flex-shrink: 0; }
.qfp-inbar-chip-name   { font-size: 12.5px; color: rgba(255,255,255,0.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; font-weight: 400; }
.qfp-inbar-chip-id     { font-size: 10px; color: rgba(255,255,255,0.24); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.qfp-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: rgba(10,10,16,0.98);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 13px; max-height: 240px; overflow-y: auto;
  z-index: 300;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  display: none; transform-origin: top center;
  padding: 4px;
}
.qfp-dropdown.open {
  display: block;
  animation: qfp-dd-open 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes qfp-dd-open {
  from { opacity: 0; transform: scaleY(0.92) translateY(-6px); }
  to   { opacity: 1; transform: scaleY(1)   translateY(0); }
}
.qfp-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  transition: background 0.12s;
  border-radius: 9px;
}
.qfp-dropdown-item:hover,
.qfp-dropdown-item.highlighted { background: rgba(255,255,255,0.06); }
.qfp-dropdown-name  { flex: 1; min-width: 0; font-size: 12.5px; color: rgba(255,255,255,0.86); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qfp-dropdown-type  { font-size: 9.5px; color: rgba(244,235,51,0.65); background: rgba(244,235,51,0.07); border-radius: 5px; padding: 2px 6px; flex-shrink: 0; }
.qfp-dropdown-id    { font-size: 9.5px; color: rgba(255,255,255,0.22); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.qfp-dropdown-empty { padding: 14px; font-size: 12px; color: rgba(255,255,255,0.28); text-align: center; }
.qfp-dropdown-empty strong { color: rgba(255,255,255,0.48); }
.qfp-dropdown::-webkit-scrollbar       { width: 4px; }
.qfp-dropdown::-webkit-scrollbar-track { background: transparent; }
.qfp-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* ── Param rows ──────────────────────────────────────────────────────────── */
.qfp-param-row {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px; padding: 14px 16px;
  background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,255,255,0.07);
  border-radius: 12px;
}
.qfp-param-row.qfp-param-visible { display: flex; }
.qfp-param-label { display: flex; align-items: center; gap: 6px; font-size: 10px; color: rgba(255,255,255,0.36); letter-spacing: 0.04em; }
.qfp-param-icon  { color: rgba(244,235,51,0.5); font-size: 9px; }
.qfp-ai-badge {
  font-size: 9px;
  background: rgba(139,92,246,0.12); color: rgba(167,139,250,0.88);
  border: 1px solid rgba(139,92,246,0.22);
  border-radius: 5px; padding: 2px 7px; letter-spacing: 0.04em;
}

/* ── AI toggle button ────────────────────────────────────────────────────── */
.qfp-ai-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-family: inherit; font-weight: 600; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(139,92,246,0.25);
  background: rgba(139,92,246,0.06); color: rgba(167,139,250,0.60);
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; margin-left: auto;
}
.qfp-ai-toggle:hover { border-color: rgba(139,92,246,0.50); color: rgba(167,139,250,0.9); background: rgba(139,92,246,0.12); }
.qfp-ai-toggle.active {
  background: rgba(139,92,246,0.20); border-color: rgba(167,139,250,0.55); color: #c4b5fd;
}

.qfp-param-input {
  background: rgba(255,255,255,0.035) !important; border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important; font-size: 12.5px !important;
  color: rgba(255,255,255,0.75) !important; padding: 9px 14px !important;
}
.qfp-param-input:focus { border-color: rgba(244,235,51,0.35) !important; background: rgba(255,255,255,0.05) !important; outline: none !important; }
.qfp-param-input.qfp-param-ai-active { border-color: rgba(139,92,246,0.40) !important; background: rgba(139,92,246,0.04) !important; box-shadow: 0 0 0 3px rgba(139,92,246,0.08) !important; }
.qfp-param-input.qfp-param-ai-active:focus { border-color: rgba(167,139,250,0.60) !important; box-shadow: 0 0 0 3px rgba(139,92,246,0.14) !important; }
.qfp-param-hint { font-size: 10.5px; color: rgba(255,255,255,0.22); line-height: 1.5; }
.qfp-param-hint code { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: rgba(255,255,255,0.36); }

/* ── Field error ─────────────────────────────────────────────────────────── */
.qfp-field-error { font-size: 10.5px; color: #ef4444; display: none; margin-top: 4px; }

/* ── Hint text ───────────────────────────────────────────────────────────── */
.qfp-hint {
  font-size: 11.5px; color: rgba(255,255,255,0.30); line-height: 1.55; margin-top: 6px;
  font-weight: 300;
}
.qfp-hint code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px; padding: 1px 5px;
  color: rgba(255,255,255,0.55);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.qfp-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 16px 28px 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 6px; flex-shrink: 0;
}
.qfp-btn {
  border-radius: 12px; font-size: 13px; font-family: inherit;
  padding: 10px 22px; cursor: pointer; letter-spacing: 0.02em;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 7px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-weight: 500;
}
.qfp-btn-cancel {
  background: transparent; border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.40);
}
.qfp-btn-cancel:hover {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75);
  border-color: rgba(255,255,255,0.14);
}
.qfp-btn-submit {
  background: #F4EB33;
  color: #0a0a0e; font-weight: 700; font-size: 13px;
  padding: 12px 30px; letter-spacing: 0.01em;
  border-radius: 12px;
}
.qfp-btn-submit:hover {
  background: #fff97a;
}
.qfp-btn-submit:active { background: #e5d900; }
.qfp-btn-submit:disabled { opacity: 0.28; cursor: not-allowed; background: #F4EB33; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .qfp-row { grid-template-columns: 1fr; }
  .qfp-var-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .qfp-header { padding: 18px 20px 14px; }
  .qfp-body   { padding: 18px 20px 6px; }
  .qfp-footer { padding: 14px 20px 16px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   EVENT MAPPING TABLE — Elevated card-based design
   ═══════════════════════════════════════════════════════════════════════════ */

.qfp-gads-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 8px;
}

.qfp-gads-map-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) auto 1.5fr auto;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 14px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.qfp-gads-map-row:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.10);
}

/* Event name — chip style */
.qfp-gads-evt {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  font-size: 12.5px; font-weight: 500;
  outline: none;
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 0;
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
  letter-spacing: -0.01em;
}
.qfp-gads-evt:focus {
  border-color: rgba(244,235,51,0.35);
  background: rgba(255,255,255,0.08);
}
.qfp-gads-evt::placeholder { color: rgba(255,255,255,0.22); font-family: inherit; }

/* Conversion label input */
.qfp-gads-lbl {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.80);
  font-size: 12.5px;
  outline: none;
  padding: 6px 2px;
  font-family: inherit;
  min-width: 0;
  transition: border-color 0.15s;
}
.qfp-gads-lbl:focus { border-bottom-color: rgba(244,235,51,0.40); }
.qfp-gads-lbl::placeholder { color: rgba(255,255,255,0.16); }

/* Arrow */
.qfp-gads-arrow {
  color: rgba(255,255,255,0.18);
  font-size: 14px;
  user-select: none;
  display: flex;
  align-items: center;
}

/* Delete button */
.qfp-gads-del {
  background: none; border: none;
  color: rgba(255,255,255,0.15);
  cursor: pointer; font-size: 12px; padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
  line-height: 1;
  opacity: 0;
}
.qfp-gads-map-row:hover .qfp-gads-del { opacity: 1; }
.qfp-gads-del:hover { color: #ff5050; background: rgba(255,80,80,0.10); }

/* Add row button */
.qfp-gads-add-row {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 12px;
  color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 12px;
  padding: 9px 16px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit; width: 100%; text-align: center;
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.qfp-gads-add-row:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.70);
  border-color: rgba(255,255,255,0.20);
}

.qfp-section-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; opacity: 0.50; margin: 16px 0 8px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   UPD TOGGLE & FIELDS
   ═══════════════════════════════════════════════════════════════════════════ */

.qfp-upd-toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.qfp-upd-toggle-btn {
  width: 38px; height: 22px; border-radius: 20px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer; position: relative; transition: all 0.22s ease;
  flex-shrink: 0; padding: 0;
}
.qfp-upd-toggle-btn.active { background: #F4EB33; border-color: #F4EB33; }
.qfp-upd-toggle-pip {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,0.55); position: absolute; top: 2px; left: 2px;
  transition: left 0.22s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
}
.qfp-upd-toggle-btn.active .qfp-upd-toggle-pip { left: 18px; background: #0a0a0e; }
.qfp-upd-fields { display: flex; flex-direction: column; gap: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   FIELD CARD SYSTEM (v6)
   ═══════════════════════════════════════════════════════════════════════════ */

.qfp-field-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: visible;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 8px;
  position: relative;
}
.qfp-field-card:hover {
  border-color: rgba(255,255,255,0.12);
}

.qfp-field-card.required {
  border-left: 2.5px solid rgba(244,235,51,0.45);
  background: rgba(244,235,51,0.012);
}
.qfp-field-card.required:hover { border-left-color: rgba(244,235,51,0.75); }

.qfp-field-card.completed { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.03); }
.qfp-field-card.completed:hover { border-color: rgba(16,185,129,0.40); }

/* Card header */
.qfp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}
.qfp-card-label-group { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.qfp-card-label {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  display: flex; align-items: center; gap: 7px;
}
.qfp-card-hint { font-size: 10.5px; color: rgba(255,255,255,0.24); letter-spacing: 0.01em; line-height: 1.4; }

/* Completion check */
.qfp-card-check {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(16,185,129,0.12); border: 1.5px solid rgba(16,185,129,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #10b981;
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  flex-shrink: 0;
}
.qfp-field-card.completed .qfp-card-check { opacity: 1; transform: scale(1); }

/* Source toggle */
.qfp-source-toggle {
  display: flex;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px; padding: 2px; gap: 1px; flex-shrink: 0;
}
.qfp-source-btn {
  background: transparent; border: none; border-radius: 7px;
  font-size: 10.5px; font-family: inherit;
  color: rgba(255,255,255,0.30); padding: 5px 11px;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  white-space: nowrap; letter-spacing: 0.02em; line-height: 1.2;
}
.qfp-source-btn:hover { color: rgba(255,255,255,0.55); }
.qfp-source-btn.active { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.90); }
.qfp-source-btn[data-mode="ai"].active    { background: rgba(139,92,246,0.15); color: #c4b5fd; }
.qfp-source-btn[data-mode="const"].active { background: rgba(244,235,51,0.08); color: #F4EB33; }

/* Card body */
.qfp-card-body { padding: 12px 16px 14px; }

/* Backward-compat: old qfp-upd-field-row */
.qfp-upd-field-row {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; overflow: visible; transition: border-color 0.18s; margin-bottom: 8px;
}
.qfp-upd-field-row:hover { border-color: rgba(255,255,255,0.12); }
.qfp-upd-field-row .qfp-var-header       { padding: 10px 14px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.qfp-upd-field-row .qfp-field-group,
.qfp-upd-field-row .qfp-convention-badge  { margin: 0; }
.qfp-upd-field-row > div:not(.qfp-var-header) { padding: 10px 14px 12px; }

/* ── Optional fields accordion ───────────────────────────────────────────── */
.qfp-optional-toggle {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 11px 16px;
  color: rgba(255,255,255,0.45); font-size: 12px; font-family: inherit;
  cursor: pointer; width: 100%; text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s; letter-spacing: 0.01em;
  font-weight: 400;
}
.qfp-optional-toggle:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75); border-color: rgba(255,255,255,0.12); }
.qfp-opt-chevron { font-size: 12px; transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); opacity: 0.45; }
.qfp-opt-chevron.open { transform: rotate(90deg); opacity: 0.75; }

/* Checkbox grid */
.qfp-optional-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px; margin-top: 12px;
}
.qfp-opt-check-label {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; user-select: none;
}
.qfp-opt-check-label:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }
.qfp-opt-check-label:has(input:checked) { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.25); }
.qfp-opt-check {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.03);
  cursor: pointer; flex-shrink: 0; position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.qfp-opt-check:checked { background: #10b981; border-color: #10b981; }
.qfp-opt-check:checked::after {
  content: ''; position: absolute; left: 3px; top: 1px;
  width: 5px; height: 8px;
  border: 2px solid #000; border-top: none; border-left: none;
  transform: rotate(45deg);
}
.qfp-opt-check-name { font-size: 12px; color: rgba(255,255,255,0.55); transition: color 0.15s; }
.qfp-opt-check-label:has(input:checked) .qfp-opt-check-name { color: rgba(255,255,255,0.9); }

/* ── Inline clear button ─────────────────────────────────────────────────── */
.qfp-clear {
  background: transparent; border: none;
  color: rgba(255,255,255,0.25); font-size: 14px;
  padding: 0 11px; cursor: pointer;
  transition: color 0.15s; line-height: 1; flex-shrink: 0;
}
.qfp-clear:hover { color: rgba(255,255,255,0.70); }

/* ── Chip clear ──────────────────────────────────────────────────────────── */
.qfp-chip-clear {
  background: none; border: none;
  color: rgba(255,255,255,0.35); font-size: 13px;
  cursor: pointer; padding: 0 3px;
  transition: color 0.15s; line-height: 1;
}
.qfp-chip-clear:hover { color: rgba(255,255,255,0.8); }

/* ── Remove button (UPD fields) ──────────────────────────────────────────── */
.qfp-upd-remove {
  background: none; border: none;
  color: rgba(255,255,255,0.18); font-size: 12px;
  cursor: pointer; padding: 3px 5px; border-radius: 5px;
  transition: all 0.15s;
}
.qfp-upd-remove:hover { color: #ff5050; background: rgba(255,80,80,0.08); }
