/* ================================== Guided Query ==================================
   components/guided-query.js + guided-universe.js. A data universe around ordinary, durable controls.
   Colour has a job: orange = the current step / primary action, electric blue = data, violet = the guide and AI,
   green = done / valid, red = errors only. Surfaces stay deep navy (dark) or soft white (light).
   Motion: transform, opacity and stroke offsets only; nothing moves under reduced motion or the compact view. */

.guided-pane { display: none; }
.workspace-panes[data-mode="guided"] .builder-pane,
.workspace-panes[data-mode="guided"] .editor-pane,
.workspace-panes[data-mode="guided"] .viz-pane,
.workspace-panes[data-mode="guided"] > .resizer { display: none; }
.workspace-panes[data-mode="guided"] .guided-pane { display: flex; flex: 1; min-width: 0; }

#mode-tabs .mode-guided svg { color: var(--accent-primary); margin-right: 5px; vertical-align: -2px; }

.gq {
  --gq-orange: var(--accent-primary);
  --gq-blue: #4c8dff;
  --gq-violet: #a08bff;
  --gq-violet-soft: rgba(160, 139, 255, 0.11);
  --gq-violet-border: rgba(160, 139, 255, 0.32);
  --gq-green: #3ccf8e;
  --gq-glass: rgba(18, 23, 40, 0.62);
  --gq-glass-strong: rgba(24, 30, 52, 0.86);
  --gq-edge: rgba(140, 160, 220, 0.16);
  --gq-edge-strong: rgba(140, 160, 220, 0.28);
  --gq-line: rgba(140, 160, 220, 0.30);
  --gq-text-2: #aab3c8;
  --gq-text-3: #7d879e;
  --mx: 0; --my: 0;
  position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; overflow: hidden; isolation: isolate;
  background: radial-gradient(110% 80% at 28% -10%, #1b2248 0%, #0e1222 48%, #090c16 100%);
  color: var(--text-primary);
}
:root[data-theme="light"] .gq {
  --gq-blue: #2f6fe6; --gq-violet: #6d55e8; --gq-violet-soft: rgba(109, 85, 232, 0.07); --gq-violet-border: rgba(109, 85, 232, 0.24);
  --gq-green: #17a368;
  --gq-glass: rgba(255, 255, 255, 0.78); --gq-glass-strong: #ffffff;
  --gq-edge: rgba(30, 50, 100, 0.10); --gq-edge-strong: rgba(30, 50, 100, 0.18); --gq-line: rgba(47, 111, 230, 0.28);
  --gq-text-2: #4d5870; --gq-text-3: #7a849a;
  background: radial-gradient(110% 80% at 28% -10%, #eef2fc 0%, #f6f8fc 50%, #f3f5f9 100%);
}
.gq-layout { position: relative; z-index: 1; flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 27%, 420px); }

/* Atmosphere: one canvas of data points + soft light ----------------------------------------------------------------- */
.gq-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.gq-cosmos { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 30% at 72% 8%, rgba(160, 139, 255, 0.13), transparent 70%),
    radial-gradient(30% 26% at 12% 30%, rgba(76, 141, 255, 0.10), transparent 70%),
    radial-gradient(50% 22% at 45% 105%, rgba(247, 137, 31, 0.07), transparent 70%); }
:root[data-theme="light"] .gq-cosmos {
  background:
    radial-gradient(38% 30% at 72% 8%, rgba(109, 85, 232, 0.06), transparent 70%),
    radial-gradient(30% 26% at 12% 30%, rgba(47, 111, 230, 0.06), transparent 70%); }

/* Layout --------------------------------------------------------------------------------------------------------------- */
.gq-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.gq-scroll { flex: 1; min-height: 0; overflow: auto; padding: 4px 26px 22px; scroll-behavior: smooth; }
.gq-side { min-height: 0; overflow: auto; padding: 14px 14px 16px 2px; display: flex; flex-direction: column; gap: 12px; }

/* Small pills ---------------------------------------------------------------------------------------------------------------- */
.gq-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--gq-glass); border: 1px solid var(--gq-edge-strong); }
.gq-badge .icon { color: var(--gq-orange); }
.gq-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer;
  color: var(--gq-text-2); background: var(--gq-glass); border: 1px solid var(--gq-edge); }
.gq-pill:hover { color: var(--text-primary); border-color: var(--gq-edge-strong); }
.gq-pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-pill.violet { color: var(--gq-violet); border-color: var(--gq-violet-border); background: var(--gq-violet-soft); }
.gq-x { width: 20px; height: 20px; }

/* The Query Galaxy: the query at the centre, the steps around it ----------------------------------------------------------- */
.gq-galaxy { position: relative; flex: none; height: clamp(290px, 43%, 390px); padding: 10px 22px 0; display: flex; flex-direction: column; }
.gq-first .gq-galaxy { flex: 1; height: auto; min-height: 460px; }
.gq-g-where { position: absolute; top: 10px; left: 22px; right: 22px; display: flex; align-items: center; gap: 10px; z-index: 3; pointer-events: none; }
.gq-g-where > * { pointer-events: auto; }
.gq-g-step { font-size: 12px; color: var(--gq-text-3); }
.gq-g-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.gq-g-head { text-align: center; padding-top: 34px; position: relative; z-index: 2; }
.gq-g-head:empty { display: none; }
.gq-g-title { margin: 0; font-size: 30px; font-weight: 750; letter-spacing: -.015em;
  background: linear-gradient(90deg, var(--text-primary), color-mix(in srgb, var(--gq-violet) 70%, var(--text-primary))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gq-g-sub { margin: 4px 0 0; color: var(--gq-text-2); font-size: 14px; }
.gq-g-space { position: relative; flex: 1; min-height: 0; }
.gq-g-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.gq-g-rings ellipse { fill: none; stroke: var(--gq-line); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .55; }
.gq-g-rings ellipse.r2 { stroke-dasharray: 2 6; opacity: .35; }

/* the core */
.gq-core { position: absolute; left: 50%; top: 50%; width: min(360px, 74%, calc(var(--gh, 360px) * .9)); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2;
  display: grid; place-items: center; }
.gq-galaxy .gq-core { width: clamp(232px, 30vh, 312px); }
.gq-first .gq-core { width: clamp(270px, 38vh, 360px); }
.gq-core-sphere { position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, rgba(120, 140, 255, .16), transparent 62%),
    radial-gradient(circle at 50% 50%, rgba(14, 18, 36, .92) 55%, rgba(30, 36, 80, .9) 72%, rgba(90, 70, 200, .35) 86%, transparent 100%);
  box-shadow: inset 0 0 0 1px rgba(160, 139, 255, .38), inset 0 0 46px rgba(76, 141, 255, .22), 0 0 70px rgba(110, 90, 255, .22), 0 0 140px rgba(247, 137, 31, .06); }
.gq-core-sphere i { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid transparent;
  background: conic-gradient(from 210deg, rgba(247, 137, 31, .0), rgba(247, 137, 31, .55), rgba(160, 139, 255, .45), rgba(76, 141, 255, .35), rgba(247, 137, 31, 0) 70%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .9; }
.gq-core.empty .gq-core-sphere i { opacity: .45; }
.gq-core.final .gq-core-sphere { box-shadow: inset 0 0 0 1px rgba(60, 207, 142, .38), inset 0 0 40px rgba(60, 207, 142, .14), 0 0 60px rgba(60, 207, 142, .16); }
.gq-core.final .gq-core-sphere i { background: conic-gradient(from 210deg, rgba(60, 207, 142, 0), rgba(60, 207, 142, .6), rgba(76, 141, 255, .4), rgba(60, 207, 142, 0) 70%) border-box; }
:root[data-theme="light"] .gq-core-sphere {
  background: radial-gradient(circle at 50% 40%, #ffffff 0 55%, #f2f5ff 72%, rgba(109, 85, 232, .10) 88%, transparent 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 230, .22), 0 12px 40px rgba(30, 50, 120, .12); }
.gq-core-body { position: relative; width: 78%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.gq-core-mark { color: var(--gq-orange); }
.gq-core-mark .icon { width: 20px; height: 20px; }
.gq-core-title { font-size: 15px; font-weight: 750; letter-spacing: .01em; }
.gq-core.final .gq-core-title { color: var(--gq-green); }
.gq-core-intent .gq-core-val { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gq-text-3); padding: 1px 9px; border-radius: 999px;
  border: 1px dashed var(--gq-edge-strong); }
.gq-core-intent.set .gq-core-val { color: var(--gq-orange); border-style: solid; border-color: color-mix(in srgb, var(--gq-orange) 40%, transparent); background: color-mix(in srgb, var(--gq-orange) 10%, transparent); }
.gq-galaxy:not(.has-around) .gq-core-sentence { -webkit-line-clamp: 2; }
.gq-core-sentence { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.4; color: var(--gq-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gq-core-rows { margin: 0; width: 100%; display: flex; flex-direction: column; gap: 3px; }
.gq-core-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--gq-glass-strong) 70%, transparent); border: 1px solid var(--gq-edge); transition: border-color .3s, background .3s; }
.gq-core-row dt { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; color: var(--gq-text-3); text-align: left; }
.gq-core-row dt .icon { width: 11px; height: 11px; }
.gq-core-row dd { margin: 0; min-width: 0; text-align: left; }
.gq-core-val { max-width: 100%; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--gq-text-3); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-align: left; }
.gq-core-val:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
.gq-core-val:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
.gq-core-row.set { border-color: color-mix(in srgb, var(--gq-blue) 30%, var(--gq-edge)); }
.gq-core-row.set dt { color: var(--gq-blue); }
.gq-core-row.set .gq-core-val { color: var(--text-primary); }
.gq-core.empty .gq-core-row { border-style: dashed; }
.gq-anim .gq-core-row.lit, .gq-anim .gq-core-intent.lit .gq-core-val { animation: gq-lit 1.1s ease-out .3s both; }
@keyframes gq-lit { 0% { box-shadow: 0 0 0 0 rgba(247, 137, 31, .5); background: color-mix(in srgb, var(--gq-orange) 22%, transparent); } 100% { box-shadow: 0 0 0 6px rgba(247, 137, 31, 0); } }
/* the chip flying into the core */
.gq-fly { position: fixed; z-index: 2000; pointer-events: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; color: #1c1206;
  background: linear-gradient(90deg, #ffd29a, var(--accent-primary, #f7891f)); box-shadow: 0 6px 20px rgba(247, 137, 31, .45); transform: translate(-50%, -50%); }

/* the steps around it */
.gq-g-nodes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gq-g-node { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.gq-g-node button { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; text-align: left; border-radius: 14px; }
.gq-g-node.left button { flex-direction: row-reverse; text-align: right; }
.gq-g-node button:disabled { cursor: default; }
.gq-g-node button:focus-visible { outline: none; }
.gq-g-node button:focus-visible .gq-g-orb { box-shadow: var(--focus-ring); }
.gq-g-orb { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--gq-text-3);
  background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, background .3s, color .3s, width .3s, height .3s; }
.gq-g-orb .icon { width: 16px; height: 16px; }
.gq-g-check { position: absolute; right: -3px; top: -3px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; background: var(--gq-green); color: #04210f; }
.gq-g-check .icon { width: 9px; height: 9px; }
.gq-g-text { display: flex; flex-direction: column; min-width: 0; max-width: 170px; }
.gq-g-text b { font-size: 13px; font-weight: 650; white-space: nowrap; color: var(--gq-text-2); }
.gq-g-text small { font-size: 11.5px; color: var(--gq-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* done: glowing satellites with their answer */
.gq-g-node.done .gq-g-orb { color: var(--gq-green); background: color-mix(in srgb, var(--gq-green) 13%, var(--gq-glass-strong)); border-color: color-mix(in srgb, var(--gq-green) 50%, transparent);
  box-shadow: 0 0 16px rgba(60, 207, 142, .22); }
.gq-g-node.done .gq-g-text b { color: var(--text-primary); }
.gq-g-node.done .gq-g-text small { color: var(--gq-text-2); }
.gq-g-node.done button:hover .gq-g-orb { transform: scale(1.08); }
/* current: the one strong node */
.gq-g-node.current { z-index: 4; }
.gq-g-node.current .gq-g-orb { width: 54px; height: 54px; color: #1c1206; border-color: transparent;
  background: radial-gradient(circle at 34% 28%, #ffd29a, var(--gq-orange) 58%, #c4560a 100%);
  box-shadow: 0 0 0 7px rgba(247, 137, 31, .12), 0 0 28px rgba(247, 137, 31, .45); transform: translate(calc(var(--mx) * 2px), calc(var(--my) * 2px)); }
.gq-g-node.current .gq-g-orb .icon { width: 22px; height: 22px; }
.gq-g-node.current .gq-g-text b { color: var(--text-primary); font-size: 16px; font-weight: 750; }
.gq-g-node.current .gq-g-text small { color: var(--gq-orange); font-size: 12px; }
/* future: faint destinations; not needed: fainter */
.gq-g-node.next .gq-g-orb { width: 30px; height: 30px; opacity: .7; }
.gq-g-node.next .gq-g-orb .icon { width: 13px; height: 13px; }
.gq-g-node.next .gq-g-text b { font-size: 12px; font-weight: 550; color: var(--gq-text-3); }
.gq-g-node.next button:not(:disabled):hover .gq-g-orb { opacity: 1; }
.gq-g-node.skipped { opacity: .4; }
.gq-g-node.skipped .gq-g-orb { width: 24px; height: 24px; border-style: dashed; background: transparent; }
.gq-g-node.skipped .gq-g-orb .icon { width: 11px; height: 11px; }
.gq-g-node.skipped .gq-g-text b { font-size: 11.5px; font-weight: 500; }
/* barely-there drift (1-2 px) and a slow pulse on the current node - never a rotation */
.gq-anim .gq-g-node .gq-g-orb { animation: gq-drift 7s ease-in-out infinite; animation-delay: calc(var(--d) * -1s); }
.gq-anim .gq-g-node.current .gq-g-orb { animation: gq-pulse 3.2s ease-in-out infinite; }
@keyframes gq-drift { 50% { translate: 0 -2px; } }
@keyframes gq-pulse { 50% { box-shadow: 0 0 0 10px rgba(247, 137, 31, .06), 0 0 34px rgba(247, 137, 31, .55); } }
:root[data-theme="light"] .gq-g-node.current .gq-g-orb { box-shadow: 0 0 0 7px rgba(247, 137, 31, .12), 0 8px 20px rgba(247, 137, 31, .32); }
/* the review: the rest dims, the core completes */
.gq-galaxy.final .gq-g-node:not(.current) { opacity: .6; }
.gq-galaxy.final .gq-g-node.current .gq-g-orb { background: radial-gradient(circle at 34% 28%, #b8f5d6, var(--gq-green) 58%, #0d7a4c 100%); color: #052314;
  box-shadow: 0 0 0 7px rgba(60, 207, 142, .12), 0 0 28px rgba(60, 207, 142, .45); animation: none; }
.gq-galaxy.final .gq-g-node.current .gq-g-text small { color: var(--gq-green); }

/* the first question: its choices around the empty core */
.gq-g-around { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; z-index: 3; pointer-events: none; }
.gq-g-col { display: flex; flex-direction: column; gap: 12px; width: min(270px, 30%); pointer-events: auto; }
.gq-g-col.left .gq-intent-card:nth-child(2) { transform: translateX(-18px); }
.gq-g-col.right .gq-intent-card:nth-child(2) { transform: translateX(18px); }
.gq-g-around .gq-intent-card { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; min-height: 0; }
.gq-g-around .gq-intent-card .gq-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gq-g-around .gq-intent-card small { font-size: 12px; }
.gq-g-around .gq-intent-card:hover { transform: translateY(-2px); }
.gq-g-col.left .gq-intent-card:nth-child(2):hover { transform: translate(-18px, -2px); }
.gq-g-col.right .gq-intent-card:nth-child(2):hover { transform: translate(18px, -2px); }

/* The question card: the guide beside the question ----------------------------------------------------------------------- */
.gq-stage { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 18px; padding: 14px 18px 16px; }
.gq-stage.wide { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.gq-stage.wide .gq-guide { flex-direction: row; align-items: center; gap: 10px; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--gq-edge); }
.gq-stage.wide .gq-guide-orb { width: 30px; height: 30px; margin: 0; }
.gq-stage.wide .gq-guide-text { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.gq-stage.wide .gq-guide-line { font-size: 14px; }
.gq-stage .gq-guide { flex-direction: column; gap: 10px; margin: 0; padding-right: 18px; border-right: 1px solid var(--gq-edge); }
.gq-guide-text { display: flex; flex-direction: column; gap: 3px; }
.gq-guide-line { font-size: 15px; font-weight: 700; }
.gq-stage .gq-guide-hint { font-size: 12.5px; }
.gq-stage-main { min-width: 0; }
.gq-stage-main > .gq-question { margin-bottom: 12px; }

/* The bottom bar: current request + the way forward ---------------------------------------------------------------------- */
.gq-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 10px 22px; border-top: 1px solid var(--gq-edge); background: var(--gq-glass); backdrop-filter: blur(10px); }
.gq-request { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 12px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--gq-violet) 12%, var(--gq-glass)), var(--gq-glass) 70%); border: 1px solid var(--gq-violet-border); }
.gq-rq-label { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 700; color: var(--gq-violet); white-space: nowrap; }
.gq-request p { margin: 0; font-size: 14.5px; line-height: 1.5; font-weight: 550; min-width: 0; }
.gq-rq { padding: 1px 7px; border-radius: 7px; white-space: nowrap; }
.gq-rq.metric { color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gq-orange) 35%, transparent); }
.gq-rq.group { color: #ffb15a; background: rgba(247, 137, 31, .08); box-shadow: inset 0 0 0 1px rgba(247, 137, 31, .45); }
:root[data-theme="light"] .gq-rq.group { color: #b75a08; }
.gq-rq.field, .gq-rq.data { color: var(--gq-blue); background: color-mix(in srgb, var(--gq-blue) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gq-blue) 32%, transparent); }
.gq-rq.data { background: transparent; box-shadow: none; padding: 0; }
.gq-anim .gq-rq.glow { animation: gq-rq-glow 1.4s ease-out both; }
@keyframes gq-rq-glow { 0% { box-shadow: 0 0 0 0 rgba(247, 137, 31, .6), 0 0 18px rgba(247, 137, 31, .55); } 100% { box-shadow: inset 0 0 0 1px rgba(247, 137, 31, .35); } }
.gq-bar-actions { display: flex; gap: 8px; flex: none; }
.gq-bar .btn .icon { width: 12px; height: 12px; }
.gq-bar [data-act="back"] .icon { transform: rotate(180deg); }
.gq-next { box-shadow: 0 4px 16px rgba(247, 137, 31, .3); }

/* Compact view: a small stepper, the question, the blueprint ------------------------------------------------------------- */
.gq-stepper { padding: 10px 22px 6px; }
.gq-stepper-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gq-stepper ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gq-sp button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--gq-edge-strong); background: var(--gq-glass-strong);
  color: var(--gq-text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.gq-sp button:disabled { opacity: .5; cursor: default; }
.gq-sp button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-sp-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg-sunken); }
.gq-sp-dot .icon { width: 10px; height: 10px; }
.gq-sp.done .gq-sp-dot { background: var(--gq-green); color: #04210f; }
.gq-sp.done button { color: var(--text-primary); }
.gq-sp.current button { border-color: var(--gq-orange); color: var(--text-primary); font-weight: 650; }
.gq-sp.current .gq-sp-dot { background: var(--gq-orange); color: #1c1206; }
.gq-compact .gq-field, .gq-compact .gq-cosmos { display: none; }
.gq-bp-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gq-text-3); }
.gq-bp-head .icon { color: var(--gq-blue); }

/* First open (under 1 s): the field fades in, the core forms, the choices rise ------------------------------------------- */
.gq-intro .gq-field, .gq-intro .gq-cosmos { animation: gq-fade .45s ease-out both; }
.gq-intro .gq-g-rings { animation: gq-fade .5s ease-out .1s both; }
.gq-intro .gq-core { animation: gq-core-in .55s cubic-bezier(.2,.9,.3,1) .1s both; }
.gq-intro .gq-g-node { animation: gq-fade .35s ease-out both; animation-delay: calc(.3s + var(--d) * 40ms); }
.gq-intro .gq-g-head, .gq-intro .gq-intent-card, .gq-intro .gq-stage { animation: gq-rise .35s ease-out both; animation-delay: calc(.45s + var(--i, 0) * 40ms); }
@keyframes gq-fade { from { opacity: 0; } }
@keyframes gq-core-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.86); } }
@keyframes gq-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Short windows: a smaller galaxy */
@media (max-height: 860px) { .gq-galaxy { height: clamp(270px, 40%, 340px); } .gq-galaxy .gq-core { width: clamp(220px, 29vh, 280px); } .gq-core-sentence { -webkit-line-clamp: 2; } }

/* The question panel: Signeal speaking ----------------------------------------------------------------------------------- */
.gq-step { position: relative; background: var(--gq-glass); border: 1px solid var(--gq-edge-strong); border-radius: 16px; padding: 18px 20px 20px; backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22); }
:root[data-theme="light"] .gq-step { box-shadow: 0 12px 34px rgba(30, 50, 100, .08); }
.gq-guide { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.gq-guide-orb { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; margin-top: 2px;
  background: radial-gradient(circle at 36% 30%, #e3dbff, var(--gq-violet) 45%, #3b2a9a 100%); box-shadow: 0 0 0 5px var(--gq-violet-soft), 0 0 22px rgba(160, 139, 255, .45); }
.gq-guide-orb::before, .gq-guide-orb::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--gq-violet-border); opacity: 0; }
.gq-guide-orb i { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.gq-guide-orb i .icon { width: 18px; height: 18px; }
.gq-guide-name { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gq-violet); }
.gq-question { margin: 2px 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; display: flex; align-items: center; gap: 8px; }
.gq-question.xl { font-size: 27px; }
.gq-question.sm { font-size: 14.5px; margin: 18px 0 8px; font-weight: 650; }
.gq-guide-hint { margin: 2px 0 0; color: var(--gq-text-2); font-size: 13.5px; }
.gq-anim .gq-enter-fwd { animation: gq-in-fwd .36s cubic-bezier(.2, .8, .2, 1); }
.gq-anim .gq-enter-back { animation: gq-in-back .36s cubic-bezier(.2, .8, .2, 1); }
@keyframes gq-in-fwd { from { opacity: 0; transform: translate3d(24px, 0, 0); } }
@keyframes gq-in-back { from { opacity: 0; transform: translate3d(-24px, 0, 0); } }
.gq-anim .gq-guide-orb::before { animation: gq-ring 3.2s ease-out infinite; }
.gq-anim .gq-guide-orb::after { animation: gq-ring 3.2s ease-out 1.6s infinite; }
@keyframes gq-ring { 0% { opacity: .7; transform: scale(.75); } 100% { opacity: 0; transform: scale(1.35); } }
.gq-sub { margin: 16px 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gq-text-3); display: flex; align-items: center; gap: 6px; }
.gq-dim { color: var(--gq-text-3); font-size: 12.5px; }
.gq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.gq-flex { flex: 1; }
.gq-wait { display: flex; align-items: center; gap: 8px; color: var(--gq-text-2); padding: 10px 0; }
.gq-empty { display: flex; align-items: center; gap: 10px; color: var(--gq-text-2); }
.gq-empty .icon { width: 22px; height: 22px; color: var(--gq-blue); }
.gq-demo-offer { display: inline-flex; align-items: center; gap: 4px; }

/* Choice cards -------------------------------------------------------------------------------------------------------------- */
.gq-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gq-intents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gq-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gq-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; overflow: hidden;
  background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); border-radius: 14px; color: inherit; font: inherit; cursor: pointer;
  transition: border-color .18s, transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s;
}
.gq-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(70% 90% at 0% 0%, color-mix(in srgb, var(--gq-blue) 14%, transparent), transparent 70%); }
.gq-card:hover { border-color: color-mix(in srgb, var(--gq-blue) 45%, var(--gq-edge-strong)); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.gq-card:hover::after { opacity: 1; }
.gq-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-card b { font-size: 14.5px; }
.gq-card small { color: var(--gq-text-2); font-size: 12.5px; line-height: 1.4; }
.gq-card > .icon { width: 20px; height: 20px; color: var(--gq-blue); }
.gq-card.sm { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.gq-card.sm small { flex-basis: 100%; margin-left: 28px; }
.gq-card.big { flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; }
.gq-card.big .gq-card-icon { flex: none; }
.gq-card.big span.gq-card-text { display: flex; flex-direction: column; gap: 2px; }
.gq-card.selected { border-color: color-mix(in srgb, var(--gq-orange) 80%, transparent); background: color-mix(in srgb, var(--gq-orange) 9%, var(--gq-glass-strong));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gq-orange) 45%, transparent), 0 10px 30px rgba(247, 137, 31, .16); }
.gq-card.selected > .icon { color: var(--gq-orange); }
.gq-anim .gq-card.selected { animation: gq-select .32s cubic-bezier(.2,.9,.3,1.2); }
@keyframes gq-select { 0% { transform: scale(.97); } 60% { transform: scale(1.015); } 100% { transform: none; } }
.gq-card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--gq-blue);
  background: color-mix(in srgb, var(--gq-blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gq-blue) 28%, transparent); transition: color .2s, background .2s, border-color .2s; }
.gq-card-icon .icon { width: 20px; height: 20px; }
.gq-card.selected .gq-card-icon { color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 14%, transparent); border-color: color-mix(in srgb, var(--gq-orange) 35%, transparent); }
.gq-tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--gq-orange); color: #1a1206; }
.gq-intent-card { min-height: 128px; }
.gq-intent-card .gq-card-ex { margin-top: auto; font-size: 11.5px; color: var(--gq-text-3); font-style: italic; }
.gq-anim .gq-cards > *, .gq-anim .gq-chips > *, .gq-anim .gq-tables > * { animation: gq-rise .36s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes gq-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

/* Segmented choices ------------------------------------------------------------------------------------------------------ */
.gq-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-sunken); border: 1px solid var(--gq-edge); }
.gq-seg.wrap { gap: 4px; }
.gq-seg button, .gq-custom { border: 0; background: none; color: var(--gq-text-2); font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.gq-seg button:hover { color: var(--text-primary); background: var(--hover-veil); }
.gq-seg button.on, .gq-custom.on { background: var(--gq-glass-strong); color: var(--text-primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gq-orange) 55%, transparent); }
.gq-seg button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-custom .input { width: 90px; height: 26px; }
.gq-sqlword { font-family: var(--mono); font-size: 11px; padding: 0 8px; align-self: center; }

/* Data ------------------------------------------------------------------------------------------------------------------- */
.gq-data { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.gq-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 9px; background: var(--bg-sunken); border: 1px solid var(--gq-edge-strong); flex: 1; min-width: 180px; }
.gq-search:focus-within { border-color: var(--border-active); box-shadow: var(--focus-ring); }
.gq-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; }
.gq-search .icon { color: var(--gq-text-3); }
.gq-tables { display: flex; flex-direction: column; gap: 4px; }
.gq-table { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.gq-table:hover { background: var(--hover-veil); border-color: var(--gq-edge); }
.gq-table:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-table.selected { background: color-mix(in srgb, var(--gq-blue) 12%, transparent); border-color: color-mix(in srgb, var(--gq-blue) 50%, transparent); }
.gq-table-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--ni-table); background: color-mix(in srgb, var(--gq-blue) 12%, transparent); flex: none; }
.gq-table-icon.view { color: var(--ni-view); background: var(--gq-violet-soft); }
.gq-table-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gq-table-name b { font-size: 13px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.gq-table-name small, .gq-rows { font-size: 11.5px; color: var(--gq-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gq-schemas details { margin-bottom: 6px; }
.gq-schemas summary { cursor: pointer; font-size: 12.5px; color: var(--gq-text-2); padding: 4px 2px; display: flex; align-items: center; gap: 6px; }
.gq-preview-card { position: sticky; top: 0; padding: 16px; border-radius: 14px; background: var(--gq-glass-strong); border: 1px solid color-mix(in srgb, var(--gq-blue) 30%, var(--gq-edge-strong)); }
.gq-preview-card h3 { margin: 6px 0 2px; font-size: 16px; text-align: center; }
.gq-preview-card > .gq-dim { text-align: center; margin: 0; }
.gq-planet-wrap { position: relative; width: 120px; height: 92px; margin: 0 auto; display: grid; place-items: center; }
.gq-planet { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 28%, #9cc4ff, var(--gq-blue) 50%, #123a8a 100%); box-shadow: 0 0 0 6px rgba(76, 141, 255, .10), 0 0 28px rgba(76, 141, 255, .45); }
.gq-planet .icon { width: 22px; height: 22px; }
.gq-planet.ghost { opacity: .35; filter: grayscale(.4); }
.gq-moon { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--gq-violet); opacity: .85;
  transform: rotate(calc(var(--m) * 60deg)) translateX(48px) rotate(calc(var(--m) * -60deg)); }
.gq-anim .gq-moon { animation: gq-orbit 9s linear infinite; animation-delay: calc(var(--m) * -1.5s); }
@keyframes gq-orbit { from { transform: rotate(0deg) translateX(48px) scaleY(.9); } to { transform: rotate(360deg) translateX(48px) scaleY(.9); } }
.gq-anim .gq-planet-wrap { animation: gq-arrive .5s cubic-bezier(.2, .9, .2, 1); }
@keyframes gq-arrive { from { opacity: 0; transform: scale(.6); } }
.gq-planet-empty { text-align: center; color: var(--gq-text-3); padding: 24px 0; }
.gq-planet-empty .gq-planet { margin: 0 auto 10px; }
.gq-colchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.gq-colchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: var(--bg-sunken); border: 1px solid var(--gq-edge); }
.gq-colchip small { color: var(--gq-text-3); font-size: 10.5px; }
.gq-colchip .icon { color: var(--ni-pk); }
.gq-rel, .gq-join { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--gq-edge); margin-top: 6px; background: var(--bg-sunken); flex-wrap: wrap; }
.gq-rel > span { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; }
.gq-rel small, .gq-join small { flex-basis: 100%; color: var(--gq-text-3); font-size: 11.5px; }
.gq-join > div:first-child { flex: 1; min-width: 160px; display: flex; flex-direction: column; font-size: 13px; }
.gq-warn-text { color: var(--warning-text) !important; }
.gq-adv { margin-top: 8px; font-size: 12.5px; }
.gq-adv summary { cursor: pointer; color: var(--gq-text-3); }
.gq-adv code { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--code-text); }

/* Fields / chips ------------------------------------------------------------------------------------------------------- */
.gq-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gq-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; cursor: pointer;
  background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); color: var(--text-primary); transition: border-color .15s, background .15s, transform .15s; }
.gq-chip small { color: var(--gq-text-3); font-size: 10.5px; }
.gq-chip:hover { border-color: color-mix(in srgb, var(--gq-blue) 45%, var(--gq-edge-strong)); transform: translateY(-1px); }
.gq-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-chip.on { background: color-mix(in srgb, var(--gq-blue) 16%, var(--gq-glass-strong)); border-color: color-mix(in srgb, var(--gq-blue) 60%, transparent); }
.gq-chip.on .icon { color: var(--gq-blue); }
.gq-chip.ai { border-color: var(--gq-violet-border); color: var(--gq-violet); background: var(--gq-violet-soft); text-align: left; }
.gq-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.gq-order li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--bg-sunken); border: 1px solid var(--gq-edge); font-size: 13px; }
.gq-order li > span:nth-child(2) { flex: 1; }
.gq-grip { color: var(--gq-text-3); cursor: grab; display: flex; }
.gq-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; }

/* Filters: rules on the data path ---------------------------------------------------------------------------------------- */
.gq-rules { margin-top: 16px; padding: 14px 14px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gq-blue) 26%, var(--gq-edge)); background: color-mix(in srgb, var(--gq-blue) 5%, transparent); }
.gq-rules-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gq-rules-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.gq-funnel { position: relative; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--gq-blue);
  background: color-mix(in srgb, var(--gq-blue) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gq-blue) 32%, transparent); flex: none; }
.gq-funnel i { position: absolute; top: -3px; width: 4px; height: 4px; border-radius: 50%; background: var(--gq-blue); opacity: 0; }
.gq-funnel i:nth-child(2) { left: 7px; } .gq-funnel i:nth-child(3) { left: 13px; } .gq-funnel i:nth-child(4) { left: 19px; }
.gq-anim .gq-funnel.pop i { animation: gq-drop .6s ease-in both; }
.gq-anim .gq-funnel.pop i:nth-child(3) { animation-delay: .08s; } .gq-anim .gq-funnel.pop i:nth-child(4) { animation-delay: .16s; animation-name: gq-drop-out; }
@keyframes gq-drop { 0% { opacity: 0; transform: translateY(-6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(13px - var(--x, 0px)), 30px) scale(.6); } }
@keyframes gq-drop-out { 0% { opacity: 0; transform: translateY(-6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }
.gq-anim .gq-funnel.pop { animation: gq-funnel .5s ease-out; }
@keyframes gq-funnel { 40% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gq-blue) 18%, transparent); } }
.gq-filters, .gq-metrics, .gq-groups { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; align-items: flex-start; }
.gq-rules .gq-filters { margin-top: 0; gap: 0; }
.gq-filter, .gq-metric, .gq-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 11px; width: 100%;
  background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); }
.gq-filter { position: relative; border-left: 3px solid var(--gq-blue); }
.gq-filter.draft { border-left-color: var(--warning-text, #e0a030); }
.gq-filter.pending { border-style: dashed; border-left-style: solid; border-left-color: var(--gq-text-3); }
.gq-join-word { align-self: flex-start; margin: 4px 0 4px 16px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gq-blue); background: color-mix(in srgb, var(--gq-blue) 12%, transparent); position: relative; }
.gq-join-word::before, .gq-join-word::after { content: ""; position: absolute; left: 50%; width: 1px; height: 5px; background: color-mix(in srgb, var(--gq-blue) 40%, transparent); }
.gq-join-word::before { top: -5px; } .gq-join-word::after { bottom: -5px; }
.gq-add-rule { margin-top: 10px; }
.gq-filter .select, .gq-metric .select { height: 32px; max-width: 240px; }
.gq-filter > .select { flex: 1 1 140px; min-width: 0; max-width: 220px; }
.gq-values { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 170px; min-width: 0; }
.gq-values .select { max-width: 100%; }
.gq-values .input { height: 32px; width: 100%; min-width: 120px; flex: 1; }
.gq-hint { flex-basis: 100%; font-size: 12px; color: var(--warning-text); }
.gq-anim .gq-filter, .gq-anim .gq-metric, .gq-anim .gq-group { animation: gq-link .3s ease-out; }
@keyframes gq-link { from { opacity: 0; transform: translate3d(-10px, 0, 0); } }
.gq-metric-name { flex: 1; text-align: right; color: var(--gq-text-3); font-size: 12px; }
.gq-group-name { flex: 1; min-width: 140px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.gq-cluster { position: relative; height: 34px; width: 120px; margin-top: 6px; }
.gq-cluster span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gq-blue); opacity: .75; }
.gq-cluster span:nth-child(1) { left: 6px; top: 4px; } .gq-cluster span:nth-child(2) { left: 26px; top: 20px; } .gq-cluster span:nth-child(3) { left: 46px; top: 6px; }
.gq-cluster span:nth-child(4) { left: 66px; top: 22px; } .gq-cluster span:nth-child(5) { left: 86px; top: 8px; } .gq-cluster span:nth-child(6) { left: 106px; top: 18px; }
.gq-anim .gq-cluster span { animation: gq-gather .9s cubic-bezier(.4, 0, .2, 1) both; }
.gq-anim .gq-cluster span:nth-child(n+4) { animation-name: gq-gather-2; }
@keyframes gq-gather { to { left: 20px; top: 13px; background: var(--gq-orange); } }
@keyframes gq-gather-2 { to { left: 80px; top: 13px; background: var(--gq-violet); } }

/* Review: "Your query is ready." ------------------------------------------------------------------------------------------ */
.gq-ready { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.gq-review-card { padding: 14px 16px; border-radius: 13px; background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); }
.gq-review-card .gq-sub { margin-top: 0; }
.gq-review dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.gq-review dt { color: var(--gq-text-3); font-weight: 600; }
.gq-review dd { margin: 0; }
.gq-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-content: start; }
.gq-tile { padding: 12px 14px; border-radius: 13px; background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gq-tile small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gq-text-3); }
.gq-tile b { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gq-tile b .icon { width: 16px; height: 16px; }
.gq-tile.ok b { color: var(--gq-green); }
.gq-tile.bad b { color: var(--danger-text); }
.gq-tile.wide { grid-column: 1 / -1; }
.gq-tile button { align-self: flex-start; margin-top: 2px; }
.gq-final { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--gq-edge); }
.gq-final .btn-run { height: 34px; padding: 0 16px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(247, 137, 31, .3); }
.gq-warnings { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.gq-warnings:empty { display: none; }
.gq-alert { display: flex; align-items: flex-start; gap: 7px; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; }
.gq-alert > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.gq-alert small { display: block; opacity: .85; margin-top: 2px; }
.gq-plan { display: flex; flex-direction: column; gap: 6px; }
.gq-plan[open] summary { margin-bottom: 6px; }
.gq-plan summary { display: inline-flex; align-items: center; gap: 6px; }
.gq-alert .icon { flex: none; margin-top: 2px; }
.gq-alert.info { background: var(--status-info-soft); color: var(--accent-text); }
.gq-alert.warn { background: var(--status-warning-soft); color: var(--warning-text); }
.gq-alert.bad { background: var(--status-error-soft); color: var(--danger-text); }
.gq-alert.ok, .gq-ok { background: var(--status-success-soft); color: var(--success-text); }
.gq-ok { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; font-size: 12.5px; margin-top: 12px; }
.gq-result { margin-top: 14px; }
.gq-grid-wrap { max-height: 340px; overflow: auto; margin-top: 8px; border-radius: 11px; border: 1px solid var(--gq-edge-strong); }
.gq-grid { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.gq-grid th { position: sticky; top: 0; background: var(--grid-head); text-align: left; padding: 6px 10px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--grid-line); }
.gq-grid td { padding: 5px 10px; border-bottom: 1px solid var(--grid-line-soft); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; background: var(--grid-cell); }
.gq-null { color: var(--grid-null); }
.gq-anim .gq-grid tbody tr { animation: gq-rise .3s ease-out both; animation-delay: calc(var(--r, 0) * 18ms); }
.gq-flow { position: relative; height: 4px; margin-top: 12px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--gq-blue) 15%, transparent); }
.gq-flow span { position: absolute; top: 0; width: 30%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gq-blue), var(--gq-green)); left: -30%; }
.gq-anim .gq-flow span { animation: gq-flow 1.1s ease-out forwards; }
.gq-anim .gq-flow span:nth-child(2) { animation-delay: .15s; } .gq-anim .gq-flow span:nth-child(3) { animation-delay: .3s; }
@keyframes gq-flow { to { left: 100%; } }
.gq-advanced ul { margin: 8px 0; padding-left: 20px; color: var(--gq-text-2); font-size: 13px; }
.gq-advanced p { color: var(--gq-text-2); margin: 0; }

/* Blueprint: the query growing, in plain words ------------------------------------------------------------------------------ */
.gq-blueprint { margin-top: 14px; border-radius: 14px; border: 1px solid var(--gq-edge); background: var(--gq-glass); backdrop-filter: blur(8px); }
.gq-blueprint[open] summary .gq-bp-caret { transform: rotate(180deg); }
.gq-bp { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; padding: 0 6px 8px; }
.gq-bp-col { padding: 6px 10px 6px; border-left: 2px solid var(--gq-edge-strong); min-width: 0; }
.gq-bp-col.set { border-left-color: var(--gq-blue); }
.gq-bp-col.current { border-left-color: var(--gq-orange); }
.gq-bp-col small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gq-text-3); }
.gq-bp-col span { display: block; font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gq-bp-col span.none { color: var(--gq-text-3); }
.gq-anim .gq-bp-col.new { animation: gq-rise .4s cubic-bezier(.2,.8,.2,1) both; }

/* Side: generated SQL + Signeal Guide ------------------------------------------------------------------------------------- */
.gq-sqlbox, .gq-ai { border-radius: 14px; border: 1px solid var(--gq-edge-strong); background: var(--gq-glass); backdrop-filter: blur(10px); padding: 11px 12px 12px; }
.gq-sqlbox header, .gq-ai header { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.gq-sql-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-primary); font: inherit; font-weight: 650; font-size: 13px; cursor: pointer; padding: 2px; border-radius: 6px; white-space: nowrap; }
.gq-sql-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-sql-tools { display: flex; gap: 2px; width: 100%; margin-top: 4px; }
.gq-synced { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; color: var(--gq-green); }
.gq-synced i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.gq-synced.busy { color: var(--gq-text-3); }
.gq-synced.bad { color: var(--danger-text); }
.gq-sql {
  margin: 8px 0 0; padding: 10px 0; max-height: 360px; overflow: auto; border-radius: 10px; background: var(--bg-editor); border: 1px solid var(--border-subtle);
  font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--code-text); white-space: pre-wrap; word-break: break-word;
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; /* >= stays >=, as typed in SQL */
}
.gq-sql .ln { display: block; padding: 0 12px; border-left: 2px solid transparent; }
.gq-sql { counter-reset: gqln; }
.gq-sql .ln { position: relative; padding-left: 40px; counter-increment: gqln; }
.gq-sql .ln::before { content: counter(gqln); position: absolute; left: 6px; width: 22px; text-align: right; color: var(--gq-text-3); opacity: .7; }
.gq-sql .ln.chg { border-left-color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 9%, transparent); }
.gq-anim .gq-sql .ln.chg { animation: gq-line 1.8s ease-out forwards; }
@keyframes gq-line { 0% { background: color-mix(in srgb, var(--gq-orange) 22%, transparent); } 100% { background: transparent; border-left-color: transparent; } }
.gq-sql .k { color: #6fa8ff; font-weight: 600; }
.gq-sql .s { color: #f2b37b; }
:root[data-theme="light"] .gq-sql .k { color: #1d5fd1; }
:root[data-theme="light"] .gq-sql .s { color: #b0541a; }
.gq-sqlbox .gq-alert { margin-top: 8px; }
.gq-ai { border-color: var(--gq-violet-border); background: linear-gradient(165deg, var(--gq-violet-soft), transparent 65%), var(--gq-glass); }
.gq-ai header b { font-size: 13.5px; }
.gq-ai-orb { width: 20px; height: 20px; border-radius: 50%; flex: none; margin-right: 4px; background: radial-gradient(circle at 36% 30%, #e3dbff, var(--gq-violet) 50%, #3b2a9a 100%); box-shadow: 0 0 10px rgba(160, 139, 255, .5); }
.gq-ai-tag { margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 999px; color: var(--gq-violet); background: var(--gq-violet-soft); border: 1px solid var(--gq-violet-border); }
.gq-ai p { font-size: 12.5px; margin: 8px 0; line-height: 1.45; }
.gq-ai .gq-chips { margin-bottom: 8px; flex-direction: column; align-items: stretch; }
.gq-ai .gq-chip { font-size: 12px; padding: 6px 10px; border-radius: 9px; justify-content: flex-start; }
.gq-ai .gq-chip .icon { width: 12px; height: 12px; flex: none; }
.gq-tips { margin: 8px 0 4px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.gq-tips li { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.45; color: var(--gq-text-2); }
.gq-tips li .icon { flex: none; width: 13px; height: 13px; margin-top: 3px; color: var(--gq-violet); }
.gq-ai-form { display: flex; gap: 6px; }
.gq-ai-form .input { flex: 1; height: 32px; }
.gq-ai-send { color: var(--gq-violet); }
.gq-ai-reply { margin-top: 10px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; color: var(--gq-text-2); }
.gq-ai-suggest { margin-top: 10px; padding: 10px; border-radius: 9px; border: 1px solid var(--gq-violet-border); background: var(--gq-glass-strong); }
.gq-ai-suggest .gq-sub { margin-top: 0; color: var(--gq-violet); }

/* on the same step, lists don't replay their entrance on every click */
.gq-same .gq-cards > :not(.selected), .gq-same .gq-chips > *, .gq-same .gq-tables > *, .gq-same .gq-spot > *,
.gq-same .gq-filter, .gq-same .gq-metric, .gq-same .gq-group, .gq-same .gq-planet-wrap { animation: none !important; }

/* Data: a few tables as data cards ------------------------------------------------------------------------------------------ */
.gq-spot { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.gq-spotcard { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; text-align: left; border-radius: 12px; cursor: pointer; color: inherit; font: inherit;
  background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); transition: border-color .18s, transform .18s, box-shadow .18s; min-width: 0; }
.gq-spotcard:hover { border-color: color-mix(in srgb, var(--gq-blue) 50%, var(--gq-edge-strong)); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.gq-spotcard:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-spotcard.selected { border-color: color-mix(in srgb, var(--gq-blue) 75%, transparent); background: color-mix(in srgb, var(--gq-blue) 10%, var(--gq-glass-strong));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gq-blue) 40%, transparent), 0 8px 24px rgba(76, 141, 255, .18); }
.gq-spot-planet { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 28%, #a8c8ff, var(--gq-blue) 55%, #173f94 100%); box-shadow: 0 0 14px rgba(76, 141, 255, .4); }
.gq-spot-planet.view { background: radial-gradient(circle at 32% 28%, #ddd3ff, var(--gq-violet) 55%, #3b2a9a 100%); box-shadow: 0 0 14px rgba(160, 139, 255, .4); }
.gq-spot-planet .icon { width: 15px; height: 15px; }
.gq-spot-planet i { position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--gq-blue) 45%, transparent); }
.gq-anim .gq-spotcard:hover .gq-spot-planet i, .gq-anim .gq-spotcard.selected .gq-spot-planet i { animation: gq-spin 6s linear infinite; }
@keyframes gq-spin { to { transform: rotate(360deg); } }
.gq-spot-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.gq-spot-text b { font-size: 13.5px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.gq-spot-text small { font-size: 11px; color: var(--gq-text-3); white-space: normal; }
.gq-spot-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 5px; font-size: 11px; color: var(--gq-text-2); }
.gq-spot-meta span { display: inline-flex; align-items: center; gap: 3px; }
.gq-spot-meta .icon { width: 11px; height: 11px; color: var(--gq-blue); }
.gq-spot-tag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px;
  color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 12%, transparent); }
.gq-spot-tag.view { color: var(--gq-violet); background: var(--gq-violet-soft); }
.gq-anim .gq-spot > * { animation: gq-rise .36s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }

/* Fields: chips flowing into the composition ---------------------------------------------------------------------------------- */
.gq-fields-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 16px; align-items: start; }
.gq-kdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--gq-text-3); }
.k-text .gq-kdot { background: #7fb0ff; } .k-number .gq-kdot { background: var(--gq-orange); } .k-date .gq-kdot { background: var(--gq-green); } .k-boolean .gq-kdot { background: var(--gq-violet); }
.gq-fchip .icon { color: var(--gq-blue); }
.gq-compose { position: sticky; top: 0; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--gq-blue) 6%, var(--gq-glass-strong)); border: 1px solid color-mix(in srgb, var(--gq-blue) 28%, var(--gq-edge)); }
.gq-compose-block > small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gq-blue); margin-bottom: 6px; }
.gq-compose-block > small .gq-dim { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 10.5px; }
.gq-compose-src { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; margin: 0 4px 4px 0;
  background: color-mix(in srgb, var(--gq-blue) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gq-blue) 35%, transparent); }
.gq-compose-src.join { font-weight: 500; }
.gq-compose-flow { position: relative; height: 22px; margin: 2px 0 6px 18px; border-left: 1px dashed color-mix(in srgb, var(--gq-blue) 45%, transparent); }
.gq-compose-flow i { position: absolute; left: -3px; top: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--gq-blue); opacity: 0; }
.gq-anim .gq-compose-flow i { animation: gq-drip 1.8s ease-in infinite; }
.gq-anim .gq-compose-flow i:nth-child(2) { animation-delay: .6s; } .gq-anim .gq-compose-flow i:nth-child(3) { animation-delay: 1.2s; }
@keyframes gq-drip { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(20px); } }
.gq-compose .gq-order { max-width: none; }
.gq-compose .gq-order li { background: var(--gq-glass-strong); }
.gq-compose .gq-order li > span:nth-child(2) { flex: none; }
.gq-compose .gq-order li > span:nth-child(3) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gq-anim .gq-compose .gq-order li.fresh { animation: gq-flow-in .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes gq-flow-in { from { opacity: 0; transform: translate3d(-40px, -6px, 0) scale(.92); } 60% { opacity: 1; } }
.gq-compose-all { margin: 0; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Summary: many rows becoming a few values ---------------------------------------------------------------------------------- */
.gq-sumkinds { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.gq-sumkind { padding: 13px; gap: 4px; }
.gq-sumkind .gq-card-icon { width: 34px; height: 34px; border-radius: 10px; }
.gq-sumkind b { font-size: 13.5px; line-height: 1.25; }
.gq-sumkind small { font-size: 12px; }
@media (max-width: 1500px) { .gq-sumkinds { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.gq-sumkind:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.gq-sum-body { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 14px; }
.gq-merge { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); min-height: 96px; }
.gq-merge-rows { position: relative; width: 96px; height: 64px; flex: none; }
.gq-merge-rows i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gq-blue); opacity: .8;
  left: var(--x); top: var(--y); transition: transform .45s cubic-bezier(.6,0,.2,1), opacity .45s, background .45s; }
.gq-merge.has .gq-merge-rows i { transform: translate(calc(44px - var(--x)), calc(29px - var(--y))) scale(.6); opacity: .25; }
.gq-merge.has .gq-merge-rows::after { content: ""; position: absolute; left: 40px; top: 25px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd29a, var(--gq-orange) 60%, #c4560a); box-shadow: 0 0 14px rgba(247, 137, 31, .55); }
.gq-anim .gq-merge.play .gq-merge-rows i { animation: gq-merge .48s cubic-bezier(.6,0,.2,1) both; }
.gq-anim .gq-merge.play.has .gq-merge-rows::after { animation: gq-arrive-pop .45s .3s both; }
@keyframes gq-merge { from { transform: none; opacity: .8; } }
.gq-merge-arrow { color: var(--gq-text-3); }
.gq-merge-out { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gq-merge-out b { font-size: 12.5px; font-weight: 650; padding: 4px 9px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 12%, transparent); }
.gq-merge:not(.has) .gq-merge-out b { color: var(--gq-text-3); background: var(--bg-sunken); font-weight: 500; }
.gq-anim .gq-merge.play .gq-merge-out b { animation: gq-rise .35s ease-out both; animation-delay: calc(.3s + var(--k) * 60ms); }
.gq-sum-body .gq-metrics { margin-top: 0; }

/* Group: totals branching out by a category ---------------------------------------------------------------------------------- */
.gq-groupcards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gq-groupcard { padding: 12px 14px; gap: 4px; }
.gq-groupcard .gq-card-icon { width: 34px; height: 34px; border-radius: 10px; }
.gq-groupcard.k-date .gq-card-icon { color: var(--gq-green); background: color-mix(in srgb, var(--gq-green) 12%, transparent); border-color: color-mix(in srgb, var(--gq-green) 30%, transparent); }
.gq-groupcard.k-boolean .gq-card-icon { color: var(--gq-violet); background: var(--gq-violet-soft); border-color: var(--gq-violet-border); }
.gq-branch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 160px) minmax(0, 1fr); align-items: center; gap: 0; margin-top: 16px; padding: 14px 16px;
  border-radius: 14px; background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); }
.gq-br-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gq-br-col:last-child { align-items: flex-start; }
.gq-br-col:first-child { align-items: flex-end; }
.gq-br-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gq-br-pill.metric { color: var(--gq-orange); background: color-mix(in srgb, var(--gq-orange) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gq-orange) 30%, transparent); }
.gq-br-pill.group { color: var(--gq-blue); background: color-mix(in srgb, var(--gq-blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gq-blue) 32%, transparent); }
.gq-branch.empty .gq-br-pill.group { color: var(--gq-text-3); background: var(--bg-sunken); border-color: var(--gq-edge); font-weight: 500; }
.gq-br-mid { position: relative; align-self: stretch; min-height: 54px; display: grid; place-items: center; }
.gq-br-mid svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gq-br-mid path { fill: none; stroke: color-mix(in srgb, var(--gq-blue) 55%, transparent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.gq-branch.empty .gq-br-mid path { stroke-dasharray: 0.02 0.03; stroke: var(--gq-line); }
.gq-anim .gq-branch.play .gq-br-mid path { stroke-dasharray: 1 1; animation: gq-draw .45s cubic-bezier(.4,0,.2,1) both; }
.gq-br-mid span { position: relative; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gq-text-3); padding: 2px 8px; border-radius: 999px; background: var(--gq-glass-strong); }
.gq-anim .gq-branch.play .gq-br-col:last-child .gq-br-pill { animation: gq-rise .35s ease-out .25s both; }

/* Sort: example rows gliding into order --------------------------------------------------------------------------------------- */
.gq-sort-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 240px); gap: 16px; align-items: start; }
.gq-sort-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gq-order-demo { padding: 12px; border-radius: 14px; background: var(--gq-glass-strong); border: 1px solid var(--gq-edge-strong); }
.gq-order-demo > small { display: block; font-size: 11px; color: var(--gq-text-3); margin-bottom: 8px; }
.gq-od-rows { position: relative; height: calc(6 * 26px); }
.gq-od-row { position: absolute; left: 0; right: 0; top: 0; height: 22px; display: flex; align-items: center; gap: 8px; transform: translateY(calc(var(--p) * 26px));
  transition: transform .42s cubic-bezier(.4,0,.2,1); }
.gq-od-row b { width: 58px; flex: none; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gq-od-row i { height: 8px; width: var(--w); border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--gq-blue) 70%, transparent), var(--gq-blue)); max-width: calc(100% - 66px); }
.gq-od-row.lead i { background: linear-gradient(90deg, color-mix(in srgb, var(--gq-orange) 70%, transparent), var(--gq-orange)); }

@media (max-width: 1280px) {
  .gq-fields-layout, .gq-sum-body, .gq-sort-top { grid-template-columns: minmax(0, 1fr); }
  .gq-compose { position: static; }
}
@media (max-width: 760px) { .gq-branch { grid-template-columns: minmax(0, 1fr); gap: 8px; } .gq-br-col, .gq-br-col:first-child { align-items: flex-start; } .gq-br-mid { min-height: 0; } .gq-br-mid svg { display: none; } }

/* First-run tour ---------------------------------------------------------------------------------------------------------- */
.gq-demo { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; background: var(--backdrop); backdrop-filter: blur(4px); }
.gq-demo-card { width: min(620px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 16px; background: radial-gradient(120% 120% at 20% 0%, #1d2242, #12151f 70%); color: #e6e9ef;
  border: 1px solid rgba(160, 139, 255, .35); box-shadow: var(--shadow); }
:root[data-theme="light"] .gq-demo-card { background: #fff; color: var(--text-primary); }
.gq-demo-card h2 { margin: 10px 0 4px; font-size: 20px; }
.gq-demo-card p { margin: 0 0 10px; }
.gq-demo-orbit { display: flex; flex-wrap: wrap; gap: 6px; }
.gq-demo-orbit span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); }
.gq-demo-orbit span.done { color: #4c8dff; border-color: rgba(76, 141, 255, .5); }
.gq-demo-orbit span.current { color: #1a1206; background: #f7891f; border-color: #f7891f; }
.gq-demo-card .gq-sentence { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; margin: 8px 0 12px; border-radius: 12px; font-size: 14px;
  background: rgba(160, 139, 255, .12); border: 1px solid rgba(160, 139, 255, .32); }
.gq-demo-card .gq-sentence .icon { color: #a08bff; flex: none; margin-top: 2px; }
.gq-anim .gq-demo-card { animation: gq-arrive .35s cubic-bezier(.2, .9, .2, 1); }

/* Reduced motion / compact: everything still works, nothing moves ------------------------------------------------- */
.gq:not(.gq-anim) *, .gq-demo:not(.gq-anim) * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .gq *, .gq-demo * { animation: none !important; transition: none !important; }
}


/* Smaller screens -------------------------------------------------------------------------------------------------------- */
@media (max-width: 1280px) { .gq-intents { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .gq { overflow: auto; }
  .gq-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .gq-main { min-height: 640px; }
  .gq-side { padding: 0 16px 16px; }
  .gq-data { grid-template-columns: minmax(0, 1fr); }
  .gq-preview-card { position: static; }
}
@media (max-width: 760px) {
  .gq-scroll { padding: 6px 16px 16px; }
  .gq-galaxy, .gq-first .gq-galaxy { height: auto; min-height: 0; padding: 10px 16px 8px; }
  .gq-g-where { position: static; margin-bottom: 8px; flex-wrap: wrap; }
  .gq-g-space { display: flex; flex-direction: column; gap: 10px; }
  .gq-g-rings { display: none; }
  .gq-core, .gq-galaxy .gq-core, .gq-first .gq-core { position: relative; left: auto; top: auto; transform: none; width: 100%; aspect-ratio: auto; }
  .gq-core-sphere { border-radius: 16px; }
  .gq-core-body { width: 100%; padding: 12px; }
  .gq-g-nodes, .gq-g-around { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .gq-g-node { position: static; transform: none; }
  .gq-g-node button, .gq-g-node.left button { flex-direction: row; text-align: left; padding: 3px 9px 3px 3px; border: 1px solid var(--gq-edge-strong); border-radius: 999px; }
  .gq-g-orb, .gq-g-node.current .gq-g-orb, .gq-g-node.next .gq-g-orb { width: 24px; height: 24px; transform: none !important; }
  .gq-g-text small { display: none; }
  .gq-g-node.current .gq-g-text b { font-size: 13px; }
  .gq-g-col { width: 100%; }
  .gq-g-col .gq-intent-card { transform: none !important; }
  .gq-stage { grid-template-columns: minmax(0, 1fr); }
  .gq-stage .gq-guide { border-right: 0; padding: 0; flex-direction: row; }
  .gq-bar { flex-wrap: wrap; padding: 10px 16px; }
  .gq-rq-label { display: none; }
  .gq-intents { grid-template-columns: minmax(0, 1fr); }
  .gq-values .input { width: 150px; }
  .gq-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* ============================ Simple Guided Query (beginners first) ============================
   Six plain questions, a small progress line, one large question, big answer cards, "Your request" above Back / Next.
   No canvas, no orbits, no long animations. Orange = the main action, blue = selected data, green = done, violet = AI only. */
.gq.gq-simple { background: var(--bg-app); }
:root[data-theme="light"] .gq.gq-simple { background: #f6f8fb; }
.gq-simple .gq-layout { grid-template-columns: minmax(0, 1fr); }
.gq-simple .gq-layout.with-panel { grid-template-columns: minmax(0, 1fr) clamp(320px, 30%, 430px); }
.gq-simple .gq-side { border-left: 1px solid var(--gq-edge); background: var(--bg-panel); padding: 14px; }
.gq-simple .gq-side[hidden], .gq-simple [data-sql-panel][hidden], .gq-simple [data-ai-panel][hidden] { display: none; }

.gq-top { display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--gq-edge); background: var(--bg-panel); flex-wrap: wrap; }
.gq-progress { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gq-pg button { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; color: var(--gq-text-3); font: inherit; font-size: 13px; cursor: pointer; }
.gq-pg button:disabled { cursor: default; opacity: .55; }
.gq-pg button:hover:not(:disabled) { background: var(--bg-hover); }
.gq-pg button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.gq-pg-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; border: 2px solid var(--gq-edge-strong); color: var(--gq-text-3); flex: none; }
.gq-pg-dot .icon { width: 11px; height: 11px; }
.gq-pg.done button { color: var(--text-primary); }
.gq-pg.done .gq-pg-dot { background: var(--gq-green); border-color: var(--gq-green); color: #fff; }
.gq-pg.current button { color: var(--text-primary); font-weight: 650; }
.gq-pg.current .gq-pg-dot { background: var(--gq-orange); border-color: var(--gq-orange); color: #fff; }
.gq-pg-line { width: 18px; height: 2px; border-radius: 2px; background: var(--gq-edge-strong); }
.gq-tools { margin-left: auto; display: flex; gap: 8px; }
.gq-tool { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--gq-edge-strong); background: transparent; color: var(--gq-text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.gq-tool:hover { color: var(--text-primary); background: var(--bg-hover); }
.gq-tool.ai { color: var(--gq-violet); border-color: var(--gq-violet-border); }
.gq-tool.ai.on, .gq-tool.ai:hover { background: var(--gq-violet-soft); }
.gq-tool.on { color: var(--text-primary); border-color: var(--gq-blue); }

.gq-simple .gq-scroll { padding: 28px clamp(16px, 5vw, 64px) 32px; }
.gq-simple .gq-step { max-width: 1080px; margin: 0 auto; padding: 30px clamp(18px, 3vw, 36px) 32px; background: var(--bg-panel); border: 1px solid var(--gq-edge-strong); border-radius: 18px; backdrop-filter: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.gq-simple .gq-stage { display: block; }
.gq-simple .gq-guide { display: none; }
.gq-simple .gq-question.xl { font-size: clamp(22px, 2.4vw, 28px); margin: 0; }
.gq-help { margin: 6px 0 24px; font-size: 14.5px; color: var(--gq-text-2); line-height: 1.5; }
.gq-simple .gq-question.sm { font-size: 16px; margin: 28px 0 10px; }

.gq-simple .gq-cards { gap: 14px; }
.gq-simple .gq-intents { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.gq-simple .gq-card { padding: 18px 18px 16px; border-radius: 14px; min-height: 92px; }
.gq-simple .gq-card b { font-size: 15px; }
.gq-simple .gq-card small { font-size: 13px; line-height: 1.45; }
.gq-simple .gq-card.selected { border-color: var(--gq-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gq-blue) 30%, transparent); background: color-mix(in srgb, var(--gq-blue) 7%, var(--bg-panel)); }
.gq-simple .gq-card-ex { display: none; }
.gq-simple .gq-sumkinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Data */
.gq-simple .gq-data { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.gq-simple .gq-spot { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gq-simple .gq-spotcard { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; text-align: left; }
.gq-spot-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--gq-blue); background: color-mix(in srgb, var(--gq-blue) 12%, transparent); }
.gq-simple .gq-spot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gq-simple .gq-spot-text small { color: var(--gq-text-3); font-size: 12px; }
.gq-simple .gq-spotcard.selected { border-color: var(--gq-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gq-blue) 30%, transparent); }
.gq-info { display: inline-flex; color: var(--gq-text-3); cursor: help; margin-left: auto; flex: none; }
.gq-info .icon { width: 13px; height: 13px; }
.gq-simple .gq-tables.gq-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 340px; overflow: auto; margin-top: 8px; }
.gq-simple .gq-table { display: flex; align-items: center; gap: 10px; }
.gq-simple .gq-table-name { display: flex; flex-direction: column; min-width: 0; }
.gq-simple .gq-table-name small { color: var(--gq-text-3); font-size: 11.5px; }
.gq-pick-empty { display: grid; place-items: center; gap: 8px; padding: 40px 16px; color: var(--gq-text-3); border: 1px dashed var(--gq-edge-strong); border-radius: 14px; text-align: center; }
.gq-pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.gq-pc-head h3 { margin: 0; font-size: 17px; }
.gq-pc-head p { margin: 2px 0 0; }
.gq-related { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gq-blue) 35%, transparent); background: color-mix(in srgb, var(--gq-blue) 6%, transparent); display: flex; flex-direction: column; gap: 8px; }
.gq-related-head { font-size: 13px; }
.gq-related .gq-rel { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Preview */
.gq-asked { padding: 18px 20px; border-radius: 14px; background: color-mix(in srgb, var(--gq-blue) 6%, var(--bg-panel)); border: 1px solid color-mix(in srgb, var(--gq-blue) 25%, var(--gq-edge)); display: flex; flex-direction: column; gap: 6px; }
.gq-asked small { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; color: var(--gq-text-3); font-weight: 650; }
.gq-asked p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.45; }
.gq-checked { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.gq-checked.ok { color: var(--gq-green); }
.gq-checked.bad { color: var(--danger); }
.gq-simple .gq-final { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.gq-preview-row { margin: 10px 0; }
.gq-secondary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--gq-edge); font-size: 12.5px; }
.gq-secondary .link-btn { display: inline-flex; align-items: center; gap: 5px; }

/* Bottom bar */
.gq-simple .gq-bar { background: var(--bg-panel); backdrop-filter: none; padding: 12px clamp(16px, 4vw, 48px); }
.gq-simple .gq-rq-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--gq-text-3); flex: none; }
.gq-simple .gq-bar .btn { min-height: 34px; padding: 0 16px; }
.gq-panel-title { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 860px) {
  .gq-simple .gq-data { grid-template-columns: 1fr; }
  .gq-simple .gq-layout.with-panel { grid-template-columns: 1fr; }
  .gq-simple .gq-layout.with-panel .gq-side { position: absolute; inset: 0 0 0 auto; width: min(420px, 100%); z-index: 20; box-shadow: -8px 0 24px rgba(0, 0, 0, .25); }
  .gq-pg-label { display: none; }
  .gq-pg.current .gq-pg-label { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .gq-simple * { animation: none !important; transition: none !important; } }

/* simple view: corrections */
.gq-simple .gq-sum-body { display: block; margin-top: 4px; }
.gq-simple .gq-tick { background: var(--gq-blue); color: #fff; }
.gq-simple .gq-flow { display: none; }
.gq-simple .gq-preview-card { text-align: left; background: var(--bg-panel); }
.gq-simple .gq-groupcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.gq-simple .gq-sort-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
