/* TrAIn Growth Partners: agentic analysis section */
.live-next { display: inline-block; margin-top: .9rem; color: var(--green); font-weight: 600; font-size: .95rem; text-decoration: none; border-bottom: 1px solid rgba(140, 198, 63, .45); }
.live-next:hover { border-bottom-color: var(--green); }

.agents { background: var(--white); }
.agents-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3.5rem; align-items: start; margin-bottom: 2.6rem; }
.agents-head h2 { max-width: 16ch; }
.agents-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.agents-points li { padding: 0 0 1.1rem 1.1rem; border-left: 3px solid var(--green); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .97rem; line-height: 1.55; }
.agents-points li:last-child { border-bottom: 0; padding-bottom: 0; }
.agents-points b { display: block; color: var(--navy); font-size: 1.05rem; margin-bottom: .2rem; }
.agents-cue { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; }
.agents-note { margin: .9rem 0 0; font-size: .82rem; color: var(--muted); }

/* Console */
.agent-demo {
  --ag-red: #d4574e; --ag-ink: #0b1d3a; --ag-line: #e3e8ef; --ag-soft: #f5f8fb;
  position: relative; border: 1px solid var(--ag-line); border-radius: 18px; background: var(--white);
  box-shadow: 0 30px 70px rgba(11, 29, 58, .12); overflow: hidden; font-size: 15px; line-height: 1.5;
}
.ag-top { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.1rem; background: var(--navy); color: var(--white); flex-wrap: wrap; }
.ag-title { display: flex; align-items: center; gap: .7rem; font-size: .95rem; }
.ag-title b { display: block; line-height: 1.2; }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(140, 198, 63, .25); flex: none; }
[data-phase="run"] .ag-dot { animation: ag-pulse 1.4s ease-in-out infinite; }
@keyframes ag-pulse { 50% { box-shadow: 0 0 0 8px rgba(140, 198, 63, .08); } }
.ag-sub { display: block; font-size: .8rem; color: #9fb0c8; font-weight: 500; }
.ag-status { flex: 1; min-width: 180px; font-size: .88rem; color: #d6e0ee; }
.ag-ctrls { display: flex; gap: .4rem; }
.ag-btn {
  font: inherit; font-size: .84rem; font-weight: 600; padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: var(--white);
}
.ag-btn:hover:not(:disabled) { background: var(--white); color: var(--navy); }
.ag-btn:disabled { opacity: .45; cursor: default; }
.ag-progress { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; padding: 0 1.1rem; background: var(--navy); padding-bottom: .7rem; }
.ag-progress i { height: 3px; background: rgba(255, 255, 255, .15); border-radius: 2px; overflow: hidden; }
.ag-progress b { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); }

.ag-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border-bottom: 1px solid var(--ag-line); }
.ag-dash { padding: 1.1rem 1.2rem 1.2rem; min-width: 0; }
.ag-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.ag-tab { font: inherit; font-size: .84rem; font-weight: 600; padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--ag-line); background: var(--white); color: var(--ag-ink); cursor: pointer; }
.ag-tab[aria-selected="true"] { background: var(--ag-ink); color: var(--white); border-color: var(--ag-ink); }
.ag-tab:disabled { color: #a6b0bf; cursor: default; }
.ag-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.ag-kpi { padding: .7rem .8rem; border: 1px solid var(--ag-line); border-radius: 12px; background: var(--ag-soft); min-width: 0; }
.ag-kpi-l { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); }
.ag-kpi b { display: block; font-size: 1.35rem; color: var(--ag-ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ag-kpi.in b { animation: ag-rise .45s ease-out; }
@keyframes ag-rise { from { opacity: 0; transform: translateY(6px); } }
.ag-kpi-c { display: block; font-size: .78rem; color: var(--muted); }
.ag-kpi-d { display: block; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: #4f8a14; } .neg { color: var(--ag-red); }

.ag-chart { margin-top: 1rem; border: 1px solid var(--ag-line); border-radius: 12px; padding: .8rem .9rem .3rem; }
.ag-chart-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--ag-ink); }
.ag-chart-head span { color: var(--muted); font-size: .8rem; }
#agBridge { width: 100%; height: auto; display: block; overflow: visible; }
.ag-axis { stroke: #c8d1dc; stroke-width: 1; }
.ag-link { stroke: #b7c2cf; stroke-dasharray: 3 3; }
.ag-hit { fill: transparent; }
.ag-bar[data-r]:hover .ag-hit { fill: rgba(11, 29, 58, .035); }
.ag-shape { transition: opacity .2s; }
.ag-bar.pos .ag-shape { fill: #7fb735; } .ag-bar.neg .ag-shape { fill: var(--ag-red); } .ag-bar.tot .ag-shape { fill: var(--ag-ink); }
.ag-bar[data-r] { cursor: pointer; outline: none; }
.ag-bar[data-r]:focus-visible .ag-hit { stroke: var(--green); stroke-width: 2; }
.ag-bar.sel .ag-shape { stroke: var(--ag-ink); stroke-width: 2.5; }
.ag-bar.key .ag-shape { animation: ag-glow 1.8s ease-in-out 2; }
@keyframes ag-glow { 50% { opacity: .55; } }
.ag-val { font-size: 13px; font-weight: 700; fill: var(--ag-ink); text-anchor: middle; font-family: inherit; }
.ag-lab { font-size: 12px; fill: #5b6676; text-anchor: middle; font-family: inherit; }
.ag-bar.sel .ag-lab { fill: var(--ag-ink); font-weight: 700; }
.ag-ops { font-size: 11px; fill: #7a8698; text-anchor: middle; font-family: inherit; }
.ag-ops.warn { fill: #a7861c; font-weight: 700; }

.ag-drill { margin-top: .8rem; padding: .8rem .95rem; border-radius: 12px; background: var(--ag-soft); min-height: 92px; }
.ag-drill p { margin: .35rem 0 0; font-size: .92rem; color: var(--ink); }
.ag-drill-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.ag-drill-h b { color: var(--ag-ink); }
.ag-drill-h span { font-size: .88rem; font-weight: 700; }
.ag-badge { font-size: .76rem !important; font-weight: 700; color: #7d6512 !important; background: #f6eecf; padding: .12rem .55rem; border-radius: 999px; }
.ag-drill-ops { display: flex; gap: 1.2rem; margin-top: .45rem; font-size: .84rem; color: var(--muted); }
.ag-drill-ops b { color: var(--ag-ink); }
.ag-drill blockquote { margin: .7rem 0 0; padding: .55rem .8rem; border-left: 3px solid var(--gold); background: var(--white); border-radius: 0 8px 8px 0; font-size: .9rem; color: var(--ink); animation: ag-rise .4s ease-out; }
.ag-drill cite { display: block; margin-top: .2rem; font-style: normal; font-size: .78rem; color: var(--muted); }
.ag-empty { margin: 0; color: var(--muted); font-size: .9rem; }

/* Trace */
.ag-trace { list-style: none; margin: 0; padding: .7rem .7rem .9rem; background: var(--ag-soft); border-left: 1px solid var(--ag-line); counter-reset: none; }
.ag-step { border-radius: 10px; }
.ag-step-btn { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .5rem; border: 0; background: none; font: inherit; font-size: .9rem; text-align: left; color: var(--ag-ink); cursor: pointer; border-radius: 8px; }
.ag-step-btn:hover { background: rgba(11, 29, 58, .05); }
.ag-step[data-state="todo"] .ag-step-btn { color: #9aa5b4; }
.ag-step[data-state="run"] { background: var(--white); box-shadow: 0 6px 18px rgba(11, 29, 58, .08); }
.ag-step[data-state="run"] .ag-step-t { font-weight: 700; }
.ag-ico { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c3ccd8; position: relative; }
.ag-step[data-state="run"] .ag-ico { border-color: var(--green); border-top-color: transparent; animation: ag-spin .8s linear infinite; }
@keyframes ag-spin { to { transform: rotate(360deg); } }
.ag-step[data-state="done"] .ag-ico, .ag-step[data-state="flag"] .ag-ico { border-color: var(--green); background: var(--green); }
.ag-step[data-state="done"] .ag-ico::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--navy); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ag-step[data-state="flag"] .ag-ico { border-color: var(--gold); background: var(--gold); }
.ag-step[data-state="flag"] .ag-ico::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--white); line-height: 1; }
.ag-step-body { display: none; padding: 0 .6rem .6rem 2.15rem; }
.ag-step[data-state="run"] .ag-step-body { display: block; }
.ag-step-body p { margin: 0 0 .3rem; font-size: .84rem; color: var(--muted); }
.ag-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.ag-ev li { font-size: .8rem; color: var(--ag-ink); padding-left: .9rem; position: relative; animation: ag-rise .3s ease-out; }
.ag-ev li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* Story */
.ag-story { padding: 1.1rem 1.2rem 1.2rem; }
.ag-story-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ag-story-head > div:first-child b { color: var(--ag-ink); font-size: 1.05rem; }
.ag-story-head .ag-sub { color: var(--muted); }
.ag-story-ctrl { display: flex; align-items: center; gap: .8rem; }
.ag-hint { font-size: .84rem; color: var(--muted); }
.ag-publish { padding: .6rem 1.15rem; font-size: .92rem; }
.ag-publish.is-done:disabled { opacity: 1; background: var(--tint); color: var(--green-deep); border-color: var(--green); }
.ag-publish:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.ag-story-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.6rem; align-items: start; }
.ag-story-body { max-width: 78ch; }
.ag-actions:empty { display: none; }
.ag-p { position: relative; padding: .5rem 4rem .5rem .8rem; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; transition: background .2s, border-color .2s; }
.ag-p + .ag-p { margin-top: .2rem; }
.ag-ptext { margin: 0; color: var(--ink); font-size: .95rem; }
.ag-ptext[contenteditable="true"] { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; background: var(--white); }
.ag-h .ag-ptext { font-size: 1.08rem; font-weight: 600; color: var(--ag-ink); }
.ag-ptext b { color: var(--ag-ink); }
.ag-fig { white-space: nowrap; background: #eef5e2; color: inherit; padding: 0 .15em; border-radius: 3px; cursor: help; }
.ag-fig.ok { background: #e2efcf; box-shadow: inset 0 -2px 0 #8cc63f; }
.ag-caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--ag-ink); animation: ag-blink .9s steps(1) infinite; }
@keyframes ag-blink { 50% { opacity: 0; } }
.ag-ctx { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.ag-ctx span { font-size: .76rem; color: #5b6676; border: 1px solid var(--ag-line); border-radius: 999px; padding: .05rem .55rem; }
.ag-flagged { background: #fbf6e6; border-left-color: var(--gold); }
.ag-resolved { border-left-color: var(--green); }
.ag-edited { border-left-color: var(--ag-ink); }
.ag-q { margin-top: .5rem; }
.ag-q p { margin: 0 0 .45rem; font-size: .88rem; color: var(--ink); }
.ag-q .ag-btn, .ag-memory .ag-btn { color: var(--ag-ink); border-color: #c3ccd8; background: var(--white); }
.ag-q .ag-btn:hover, .ag-memory .ag-btn:hover { background: var(--ag-ink); color: var(--white); border-color: var(--ag-ink); }
.ag-q-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.ag-edit { position: absolute; right: .5rem; top: .45rem; font: inherit; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--white); border: 1px solid var(--ag-line); border-radius: 6px; padding: .15rem .55rem; cursor: pointer; }
.ag-edit:hover { color: var(--ag-ink); border-color: var(--ag-ink); }
.ag-actions-h { margin: .5rem 0 .5rem; font-weight: 700; color: var(--ag-ink); }
.ag-actions-grid { display: grid; gap: .6rem; }
.ag-action { padding: .8rem .9rem; border: 1px solid var(--ag-line); border-radius: 12px; animation: ag-rise .4s ease-out both; }
.ag-action:nth-child(2) { animation-delay: .12s; } .ag-action:nth-child(3) { animation-delay: .24s; }
.ag-action b { color: var(--ag-ink); font-size: .95rem; }
.ag-owner { display: block; font-size: .78rem; color: var(--green-deep); font-weight: 600; margin: .15rem 0 .3rem; }
.ag-action p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* Memory */
.ag-memory[hidden] { display: none; }
.ag-memory { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.6rem; padding: 1.2rem; background: var(--navy); color: #d6e0ee; animation: ag-rise .5s ease-out; }
.ag-mem-h { margin: 0 0 .7rem; font-weight: 700; color: var(--white); }
.ag-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid rgba(255, 255, 255, .15); display: grid; gap: .8rem; }
.ag-timeline li { position: relative; font-size: .86rem; }
.ag-timeline li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: #5b7090; }
.ag-timeline li.new::before { background: var(--green); box-shadow: 0 0 0 4px rgba(140, 198, 63, .25); }
.ag-timeline li.new { animation: ag-rise .6s ease-out .15s both; }
.ag-timeline b { display: block; color: var(--white); font-weight: 600; }
.ag-timeline span { color: #9fb0c8; }
.ag-when { display: block; font-size: .76rem; font-weight: 700; color: var(--green) !important; }
.ag-trends { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ag-trends li { padding: .55rem .75rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; font-size: .86rem; }
.ag-trends b { display: block; color: var(--white); }
.ag-mem-note { margin: .8rem 0 .8rem; font-size: .86rem; color: #c9d4e3; }
.ag-memory .ag-btn { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .35); }
.ag-memory .ag-btn:hover { background: var(--white); color: var(--navy); }

.ag-tip { position: absolute; z-index: 5; width: 260px; padding: .5rem .7rem; border-radius: 8px; background: var(--navy); color: var(--white); font-size: .8rem; line-height: 1.4; pointer-events: none; box-shadow: 0 10px 24px rgba(11, 29, 58, .25); }

/* Foundation */
.agents-foundation { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.agents-foundation h3 { margin-bottom: .7rem; }
.agents-foundation p { color: var(--muted); }
.agents-src-h { margin: 0 0 .6rem; font-weight: 700; color: var(--navy); }
.agents-src { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.agents-src li { font-size: .86rem; font-weight: 600; color: var(--navy); background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem; }
.agents-roi { color: var(--ink) !important; }

@media (max-width: 1000px) {
  .ag-grid, .ag-story-cols { grid-template-columns: 1fr; }
  .ag-actions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ag-trace { border-left: 0; border-top: 1px solid var(--ag-line); }
  .agents-head, .agents-foundation { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 700px) {
  .ag-kpis { grid-template-columns: 1fr 1fr; }
  .ag-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1.2rem 1rem; padding: 0 1.2rem 2px; scrollbar-width: none; }
  .ag-tabs::-webkit-scrollbar { display: none; }
  .ag-tab { flex: none; }
  .ag-dash, .ag-story { padding-left: 1rem; padding-right: 1rem; }
  .ag-chart { padding: .7rem .4rem .2rem; }
  .ag-chart-head { padding: 0 .4rem; }
  .ag-actions-grid, .ag-memory { grid-template-columns: 1fr !important; }
  .ag-top { gap: .6rem; }
  .ag-status { order: 3; flex-basis: 100%; }
  .ag-ctrls { margin-left: auto; }
  .ag-p { padding-right: .8rem; }
  .ag-edit { position: static; margin-top: .35rem; }
  .ag-story-ctrl { width: 100%; justify-content: space-between; }
  .ag-val { font-size: 12px; }
  .ag-lab { font-size: 11.5px; }
  .ag-ops { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-demo *, .agent-demo *::before, .agent-demo *::after { animation: none !important; }
}
