/* ============================================================
   AGENT JOURNEY — the window opened from an agent card: the
   path from A to Z for that agent (steps, connect status, real
   working buttons) over the dimmed site.
   Built by js/agent-studio.js. --ags-hue comes from the card.
   ============================================================ */

.ags-lock { overflow: hidden; }

.ags-backdrop {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(5, 6, 8, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-ui);
}
.ags-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- the window ---------- */
.ags-win {
  --ags-accent: hsl(var(--ags-hue, 78) 85% 62%);
  --ags-accent-dim: hsl(var(--ags-hue, 78) 60% 50% / 0.16);
  width: min(1120px, 100%);
  height: min(680px, 100%);
  min-width: 0; min-height: 0;
  max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90% 40% at 50% 0%, hsl(var(--ags-hue, 78) 45% 16% / 0.35), transparent 70%),
    #101418;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-card-lg);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    var(--inset-highlight);
  transform: translateY(14px) scale(0.985);
  transition: transform var(--dur-med) var(--ease-pop);
  outline: none;
}
.ags-backdrop.is-open .ags-win { transform: none; }

/* ---------- header: window chrome ---------- */
.ags-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg-white-5);
  flex: none;
  min-width: 0;
}
.ags-ico {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-card);
  background: var(--ags-accent-dim);
  color: var(--ags-accent);
  box-shadow: var(--inset-highlight);
}
.ags-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 4; }
.ags-idbox { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ags-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 17px; letter-spacing: var(--ls-display); text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ags-tag {
  font-size: 11.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ags-headbtns { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }

/* honesty chip: what works today */
.ags-chip {
  flex: none; margin-left: 8px;
  padding: 4px 9px; border-radius: var(--radius-badge);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.ags-chip.is-live { background: var(--accent-20); color: var(--accent); }
.ags-chip.is-part { background: hsl(45 90% 60% / 0.14); color: hsl(45 90% 64%); }
.ags-chip.is-test { background: hsl(15 90% 60% / 0.14); color: hsl(15 90% 66%); }

.ags-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius-btn);
  background: var(--bg-elevated); color: var(--text-primary);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-ui), transform var(--dur-fast) var(--ease-pop);
}
.ags-btn:hover { background: #2B2F34; }
.ags-btn:active { transform: scale(0.96); }
.ags-btn:focus-visible { outline: none; box-shadow: var(--ring-accent); }
.ags-btn-lime { background: var(--accent); color: var(--accent-text-on); font-weight: 600; }
.ags-btn-lime:hover { background: var(--accent); filter: brightness(1.06); }

.ags-x {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-btn);
  color: var(--text-muted); font-size: 14px;
  transition: background-color var(--dur-fast) var(--ease-ui), color var(--dur-fast) var(--ease-ui);
}
.ags-x:hover { background: var(--bg-white-10); color: var(--text-primary); }
.ags-x:focus-visible { outline: none; box-shadow: var(--ring-accent); }

.ags-pane-h {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

/* ---------- journey layout ---------- */
.ags-jbody {
  flex: 1; min-height: 0; padding: 12px 14px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px;
}
.ags-jleft {
  overflow-y: auto; padding: 14px;
  background: var(--bg-terminal);
  border: 1px solid var(--bg-white-5);
  border-radius: var(--radius-card);
  box-shadow: var(--inset-highlight-soft);
}
.ags-jright { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.ags-jright .ags-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; flex: none;
  background: var(--bg-terminal);
  border: 1px solid var(--bg-white-5);
  border-radius: var(--radius-card);
  box-shadow: var(--inset-highlight-soft);
}

/* numbered A→Z steps */
.ags-jsteps { list-style: none; display: grid; gap: 10px; counter-reset: agsj; }
.ags-jstep {
  counter-increment: agsj;
  position: relative;
  padding: 11px 12px 11px 44px;
  border-radius: var(--radius-card);
  background: var(--bg-white-5);
}
.ags-jstep::before {
  content: counter(agsj);
  position: absolute; left: 12px; top: 12px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--ags-accent-dim);
  color: var(--ags-accent);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
}
.ags-jstep b {
  display: block;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.ags-jstep p { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

/* connect status rows */
.ags-jrows { display: grid; gap: 6px; }
.ags-jrow {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 12px;
}
.ags-jrow .k {
  color: var(--text-faint); flex: none;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ags-jrow .v { color: var(--text-muted); text-align: right; overflow-wrap: anywhere; }
.ags-jrow .v.is-good { color: var(--accent); }

.ags-jgame-note { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--text-faint); }

/* honesty block */
.ags-real {
  padding: 9px 11px;
  border: 1px solid rgba(52, 183, 221, 0.16);
  border-radius: var(--radius-card);
  background: var(--accent-05);
  font-family: var(--font-mono); font-size: 10px; line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.ags-real b { color: var(--accent); font-weight: 400; }
.ags-jreal { flex: none; }

/* ---------- footer ---------- */
.ags-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--bg-white-5);
  flex: none;
}
.ags-mem {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.05em; color: var(--text-faint);
}
.ags-mem b { color: var(--accent); font-weight: 400; }
.ags-footbtns { display: flex; gap: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .ags-jbody { grid-template-columns: 1fr; overflow-y: auto; }
  .ags-jleft { overflow: visible; }
  .ags-jright { overflow: visible; }
  .ags-chip { display: none; }
}
@media (max-width: 760px) {
  .ags-backdrop { padding: 0; }
  .ags-win { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .ags-tag { display: none; }
  .ags-headbtns .ags-char { display: none; }
  .ags-foot .ags-mem { font-size: 9.5px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ags-backdrop, .ags-win { transition: none; }
}
