/* Create-a-Query panel (js/sb-create-a-query.js) — sits above the composer. */

.caq-launch { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; vertical-align: middle; }
.caq-free-tag {
  font-size: 0.58rem; font-weight: 900; letter-spacing: 0.12em; color: #7ee2b8; line-height: 1;
}
.btn-caq {
  flex-shrink: 0;
  border: 1px solid #c9a227;
  background: #2e2a14;
  color: #f0d36b;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  min-height: 32px;
}
.btn-caq:hover,
.btn-caq[aria-expanded="true"] { background: #463d12; border-color: #f0d36b; }
.btn-caq[aria-pressed="true"] { background: #1f8a6c; border-color: #7ee2b8; color: #fff; }

/* AI buttons not in the user's plan (sb-plan-gate.js): greyed, still clickable so a click says why. */
.prov-opt.plan-locked,
.mux-prov-opt.plan-locked,
#abToggle.plan-locked { opacity: 0.35 !important; filter: grayscale(1); cursor: not-allowed; }

#abToggle[hidden] { display: none !important; }

.caq-panel {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 20px));
  max-height: min(66vh, 560px);
  overflow-y: auto;
  background: #16201c;
  border: 1px solid #2f5a4c;
  border-radius: 16px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
  padding: 12px 14px 14px;
  color: var(--chat-text, #e8e8e8);
  z-index: 9000;
  box-sizing: border-box;
}
.caq-panel[hidden] { display: none !important; }

.caq-head { display: flex; align-items: flex-start; gap: 10px; }
.caq-head-text { flex: 1; min-width: 0; }
.caq-title { font-weight: 800; font-size: 1rem; color: #f0d36b; letter-spacing: 0.01em; }
.caq-sub { font-size: 0.76rem; color: #b9c9c2; line-height: 1.4; margin-top: 2px; }
.caq-leave {
  background: transparent; border: 1px solid #3a6b5c; color: #9fd8c4; border-radius: 10px;
  font-size: 0.7rem; font-weight: 700; padding: 4px 8px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.caq-leave:hover { color: #fff; border-color: #7ee2b8; }
.caq-x {
  background: transparent; border: none; color: #9fb3aa; font-size: 1.5rem; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.caq-x:hover { color: #fff; }

.caq-pills { display: flex; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.caq-pill {
  border: 1px solid #3a6b5c; background: #1d2b26; color: #cfe7de; border-radius: 999px;
  padding: 7px 16px; font-weight: 800; font-size: 0.8rem; cursor: pointer; font-family: inherit;
  letter-spacing: 0.04em;
}
.caq-pill:hover { border-color: var(--teal, #3cc9a0); }
.caq-pill.is-on { background: var(--teal-dim, #1f8a6c); border-color: var(--teal, #3cc9a0); color: #fff; }
.caq-pill.is-off { opacity: 0.45; }

.caq-blurb { font-size: 0.8rem; color: #cfe0d9; margin: 4px 0 10px; line-height: 1.4; }
.caq-warn { color: #f0c36b; font-size: 0.76rem; }

.caq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.caq-item {
  text-align: left; background: #1d2925; border: 1px solid #2c4a40; border-radius: 12px;
  padding: 9px 10px; cursor: pointer; color: inherit; font-family: inherit;
  display: flex; flex-direction: column; gap: 3px;
}
.caq-item:hover { border-color: var(--teal, #3cc9a0); background: #213530; }
.caq-item.is-on { border-color: #f0d36b; background: #2a2f1c; }
.caq-item.is-off, .caq-item:disabled { opacity: 0.4; cursor: not-allowed; }
.caq-item-title { font-weight: 800; font-size: 0.8rem; color: #eaf5f0; }
.caq-item-text { font-size: 0.72rem; color: #a9bdb5; line-height: 1.35; }
.caq-item-tags { display: flex; gap: 4px; margin-top: 2px; }
.caq-tag {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid #3a6b5c; color: #9fd8c4; border-radius: 6px; padding: 1px 5px;
}
.caq-tag--web { border-color: #6b5c3a; color: #e0c98f; }

.caq-form {
  margin-top: 12px; padding: 12px; background: #0f1714; border: 1px solid #2f5a4c; border-radius: 12px;
}
.caq-form[hidden] { display: none !important; }
.caq-sentence { font-size: 0.95rem; line-height: 2.1; color: #f2f7f5; }
.caq-in {
  font-family: inherit; font-size: 0.9rem; color: #fff; background: #1e2d28;
  border: 1px solid #3a6b5c; border-radius: 8px; padding: 3px 7px; margin: 0 2px;
  max-width: 100%; box-sizing: border-box;
}
.caq-in:focus { outline: none; border-color: #f0d36b; }
.caq-in--num { width: 4.2em; }
.caq-in--long { display: block; width: 100%; margin: 6px 0 0; resize: vertical; }
.caq-in.is-missing { border-color: #e06464; background: #3a1f1f; }

.caq-target { margin-top: 10px; }
.caq-target label { display: block; font-size: 0.72rem; color: #a9bdb5; margin-bottom: 4px; }
.caq-target-row { display: flex; gap: 6px; }
.caq-in--target { flex: 1; min-width: 0; margin: 0; font-size: 0.82rem; }
.caq-pick {
  border: 1px solid #3a6b5c; background: #243029; color: var(--teal, #3cc9a0); border-radius: 8px;
  padding: 4px 10px; font-weight: 700; font-size: 0.78rem; cursor: pointer; font-family: inherit;
}
.caq-helper-note { font-size: 0.76rem; color: #f0c36b; margin: 8px 0 0; }
.caq-helper-note a { color: var(--teal, #3cc9a0); font-weight: 700; }

.caq-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.caq-cancel {
  margin-right: auto; background: transparent; border: none; color: #9fb3aa; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; font-family: inherit; padding: 8px 6px; text-decoration: underline;
}
.caq-cancel:hover { color: #fff; }
.caq-fill {
  background: transparent; border: 1px solid #3a6b5c; color: #cfe7de; border-radius: 16px;
  padding: 8px 14px; font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.caq-run {
  background: #c9a227; color: #111; border: none; border-radius: 16px; padding: 8px 22px;
  font-weight: 800; font-size: 0.85rem; cursor: pointer; font-family: inherit;
}
.caq-run:hover { filter: brightness(1.07); }

@media (max-width: 768px) {
  .caq-panel { padding: 10px 10px 12px; }
  .caq-in, .caq-in--target { font-size: 16px; }
  .caq-list { grid-template-columns: 1fr; }
  .caq-sentence { font-size: 0.9rem; }
}
