/* The agent's own page (web/agent.js, BB-75; Andrii, 21.11.2026: «секцію з агентом на всю сторінку, і щоб по
   інтерфейсу було дуже схоже на claude code»). The talk's own rules are .ask-log, .ask-msg of app.css; this file is
   the arrangement of a whole page around it: the earlier talks on the left, the talk as a narrow column in the
   middle, one large field with its buttons inside. Every colour is a token, so the themes, the dark look and the
   autopilot's glass reach the page by themselves. Classes are «agp-…» («ag-…» is the agency's). */
.agp { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); position: relative; min-height: 0; }
.agp.side-on { grid-template-columns: 268px minmax(0, 1fr); }

/* ── earlier talks ─────────────────────────────────────────────────────────────────────────────── */
.agp-side { display: none; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); background: var(--bg-muted); }
.agp.side-on .agp-side { display: flex; }
.agp-side-h { display: flex; align-items: center; gap: 2px; padding: 12px 10px 6px 16px; flex: none; }
.agp-side-h .over { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 16px; display: flex; flex-direction: column; gap: 1px; }
.agp-chat { display: flex; align-items: center; gap: 2px; padding-right: 4px; border-radius: var(--r-md); flex: none; transition: background var(--fast); }
.agp-chat:hover, .agp-chat:focus-within { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.agp-chat.on { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.agp-chat-b { flex: 1; min-width: 0; padding: 7px 8px; display: flex; flex-direction: column; gap: 1px; border-radius: var(--r-md); }
.agp-chat-t { font-size: 13px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-chat.on .agp-chat-t { font-weight: 600; }
.agp-chat small { font-size: 11.5px; line-height: 15px; color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the cross is there for the row under the pointer or the keys; where nothing hovers it is always there, quiet */
.agp-chat-x { opacity: 0; }
.agp-chat:hover .agp-chat-x, .agp-chat:focus-within .agp-chat-x { opacity: 1; }
@media (hover: none) { .agp-chat-x { opacity: .55; } }
.agp-none { padding: 6px 8px; }
.agp-list > .stack { padding: 8px; }
.agp-scrim { display: none; }

/* ── the talk ──────────────────────────────────────────────────────────────────────────────────── */
.agp-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* the corner: the list of earlier talks while it is off the screen, and a new talk once something is said */
.agp-bar { order: -1; flex: none; display: flex; gap: 2px; min-height: 40px; padding: 8px 12px 0; }
.agp.side-on .agp-bar { display: none; }
.agp.agp-home .agp-bar-new { display: none; }
/* incognito stands on the right of the corner, where Claude has it; while it is on, the button is filled */
.agp-bar-incog { margin-left: auto; }
.agp.agp-incog .agp-bar-incog { background: var(--ink); color: var(--cream); }
.agp.agp-incog .agp-bar-incog:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
/* nothing said yet: the greeting, the field and the ideas stand together a little above the middle; on a low screen
   the two empty stretches give way first and the page scrolls, so nothing is cut off at the top */
.agp.agp-home .agp-main { overflow-y: auto; }
.agp.agp-home .agp-main::before { content: ''; flex: 1 1 0; min-height: 8px; }
.agp.agp-home .agp-main::after { content: ''; flex: 1.6 1 0; min-height: 16px; }
.agp.agp-home .ask-log, .agp.agp-talk .agp-hero, .agp.agp-talk .agp-ideas { display: none; }
.agp-hero { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 24px; margin-bottom: 26px; }
.agp-hero .neuron { width: 44px; height: 44px; flex: none; color: var(--fg-muted); }
.agp-incog-mark { display: none; color: var(--fg-muted); }
.agp-incog-mark svg { width: 40px; height: 40px; stroke-width: 1.5; }
.agp.agp-incog .agp-hero .neuron { display: none; }
.agp.agp-incog .agp-incog-mark { display: inline-flex; }
/* incognito, nothing said yet: one quiet line under the greeting says what the mode does */
.agp-incog-note { display: none; flex: none; max-width: 560px; margin: -14px auto 24px; padding: 0 24px; text-align: center; font-size: 14px; line-height: 1.55; color: var(--fg-subtle); }
.agp.agp-incog.agp-home .agp-incog-note { display: block; }
.agp-hello { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; min-width: 0; overflow-wrap: anywhere; }

/* the log: the same column as the field, the person's words in a soft box, the agent's as plain text */
.agp .ask-log { flex: 1; min-height: 0; overflow-y: auto; background: transparent; gap: 18px; padding: 12px max(24px, calc((100% - 760px) / 2)) 28px; }
.agp .ask-msg { max-width: 100%; font-size: 14.5px; line-height: 1.65; }
.agp .ask-msg.me { max-width: min(82%, 560px); padding: 10px 16px; border-radius: 18px; border-bottom-right-radius: 6px; background: var(--n95); color: var(--fg); }
.agp .ask-msg.ai { padding: 0 2px; border: 0; border-radius: 0; background: none; }
.agp .ask-msg.me .att { background: var(--paper); border-color: var(--border); color: var(--fg-muted); }
/* the agent at work: what is done as quiet lines, what it does now as its line of work (workLine of ui.js) */
.agp .ask-wait { display: flex; flex-direction: column; gap: 6px; }
.agp .ask-steps { gap: 4px; }
.agp .ask-steps:not(:empty) { margin-top: 0; }
.agp .ask-step { display: flex; align-items: baseline; gap: 8px; font-size: 13px; line-height: 18px; }
.agp .ask-step::before { content: ''; flex: none; width: 5px; height: 5px; margin: 0 7.5px 1px; border-radius: 50%; background: var(--fg-faint); align-self: center; }
.agp .ask-step.was { color: var(--fg-subtle); }
.agp .wl { font-size: 13.5px; }

/* the field: one box, the text on top, the buttons inside under it */
.agp-in { flex: none; width: 100%; max-width: 808px; margin: 0 auto; padding: 0 24px 16px; }
.agp-box { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 10px 18px; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow-sm); cursor: text; transition: border-color var(--fast), box-shadow var(--fast); }
/* incognito: the field's edge is dashed for as long as the mode is on, in the talk too */
.agp.agp-incog .agp-box { border-style: dashed; }
.agp-box:focus-within { border-color: color-mix(in srgb, var(--fg) 42%, var(--border-strong)); box-shadow: var(--shadow-md); }
.agp-box textarea { display: block; width: 100%; min-height: 26px; max-height: 260px; padding: 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.55; }
.agp.agp-home .agp-box textarea { min-height: 50px; }
.agp-box textarea::placeholder { color: var(--fg-faint); }
.agp-box .att-row { padding: 0 0 4px; border-top: 0; background: transparent; }
.agp-tools { display: flex; align-items: center; gap: 6px; margin-left: -8px; cursor: default; }
.agp-send { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--cream); opacity: .32; transition: opacity var(--fast), transform var(--fast) var(--enter); }
.agp-send svg { width: 17px; height: 17px; }
.agp-send.lit { opacity: 1; }
.agp-send.lit:active { transform: scale(.94); }
.agp-send.busy { opacity: .32; cursor: default; }
/* under the field: whose brain the agent reads, and that no letter leaves without a yes */
.agp-under { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 8px 0 18px; font-size: 12.5px; line-height: 18px; color: var(--fg-subtle); }
.agp-fact { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.agp-fact svg { width: 14px; height: 14px; flex: none; }
.agp-fact span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp-fact.off { color: var(--warn-fg); }
.agp-fact.incog { color: var(--fg-muted); font-weight: 500; }

/* what to start with: a quiet list, one line each */
/* what to connect or add next, one line each (BB-130, after Claude Code's start screen): the action in ink, why in grey */
.grow-connect { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-xl); padding: 4px; background: var(--paper); }
.grow-conn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px; border-radius: var(--r-lg); font-size: 14px; line-height: 20px; text-align: left; min-width: 0; transition: background var(--fast); }
.grow-conn:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.grow-conn svg { width: 17px; height: 17px; flex: none; color: var(--fg); }
.grow-conn-a { flex: none; font-weight: 500; }
.grow-conn-w { min-width: 0; color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agp.agp-talk .grow-connect, .agp.agp-incog .grow-connect { display: none; }
@media (max-width: 560px) { .grow-conn { flex-wrap: wrap; row-gap: 0; } .grow-conn-w { flex-basis: calc(100% - 29px); margin-left: 29px; white-space: normal; } }
.agp-ideas { flex: none; width: 100%; max-width: 808px; margin: 20px auto 0; padding: 0 24px; }
.agp-ideas-h { padding: 0 18px 6px; font-size: 12.5px; line-height: 18px; color: var(--fg-subtle); }
.agp-idea { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 18px; border-radius: var(--r-xl); font-size: 14.5px; line-height: 20px; transition: background var(--fast); }
.agp-idea:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.agp-idea svg { width: 18px; height: 18px; flex: none; color: var(--fg-subtle); }
.agp-idea span { min-width: 0; }

/* a file held over the page */
.agp.dropping::after { content: ''; position: absolute; inset: 10px; z-index: 8; border: 2px dashed var(--border-strong); border-radius: var(--r-2xl); background: color-mix(in srgb, var(--paper) 70%, transparent); pointer-events: none; }

/* ── a narrower screen: the earlier talks lie over the talk when asked for ─────────────────────── */
@media (max-width: 1180px) {
  .agp.side-on { grid-template-columns: minmax(0, 1fr); }
  .agp.side-on .agp-side { display: none; }
  .agp.side-on .agp-bar { display: flex; }
  .agp.side-over .agp-side { display: flex; position: absolute; inset: 0 auto 0 0; z-index: 6; width: min(300px, 86%); background: var(--paper); box-shadow: var(--shadow-xl); animation: fade var(--base) var(--enter) both; }
  .agp.side-over .agp-scrim { display: block; position: absolute; inset: 0; z-index: 5; background: color-mix(in srgb, var(--ink) 22%, transparent); animation: fade var(--base) both; }
  :root[data-mode="dark"] .agp.side-over .agp-scrim { background: rgba(0, 0, 0, .5); }
}
@media (max-width: 640px) {
  .agp-hero { flex-direction: column; gap: 10px; margin-bottom: 20px; text-align: center; }
  .agp-hero .neuron { width: 38px; height: 38px; }
  .agp-hello { font-size: 25px; }
  .agp-in, .agp-ideas { padding-left: 12px; padding-right: 12px; }
  .agp-in { padding-bottom: 10px; }
  .agp .ask-log { padding-left: 14px; padding-right: 14px; }
  .agp .ask-msg.me { max-width: 88%; }
  /* (16 px: a phone's browser zooms into a field with smaller letters) */
  .agp-box textarea { font-size: 16px; }
  .agp-idea { padding: 10px 12px; gap: 12px; }
  .agp-ideas-h { padding-left: 12px; }
  .agp-under { padding-left: 12px; }
  /* a talk on a phone: the two quiet lines under the field give their room to the talk (not the one that says the agent is off) */
  .agp.agp-talk .agp-under:not(.warn) { display: none; }
  /* …except in incognito: the line that names the mode stays, alone */
  .agp.agp-incog.agp-talk .agp-under { display: flex; }
  .agp.agp-incog.agp-talk .agp-under .agp-fact:not(.incog):not(.off) { display: none; }
  .agp-incog-mark svg { width: 34px; height: 34px; }
  .agp-incog-note { margin-top: -10px; padding: 0 16px; }
}
