/* ══════════════════════════════════════════════════════════════════════
   Robot Assistants — roster styling.
   Rides on the Repo Library tokens (.repos-page sets --ink/--surf/etc.)
   and reuses .ax-card, .repos-search, .repos-sort and the .rm-* modal
   shell, so this reads as the same product rather than a bolt-on.
   ══════════════════════════════════════════════════════════════════════ */

.ag-tiles { margin-bottom: 2px; }

/* ── toolbar ── */
.ag-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 4px 0; }
.ag-search { flex: 1; min-width: 240px; }
.ag-note { font-size: 11.5px; color: var(--ink3); margin: 10px 4px 0; }

/* ── roster grid ── */
.ag-grid {
  display: grid; gap: 14px; padding: 16px 4px 8px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.ag-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surf); border: 1px solid var(--border); border-radius: 16px;
  padding: 15px 16px 13px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.02);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
/* the agent's colour, as a hairline down the leading edge */
.ag-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ac); opacity: .85;
}
.ag-card:hover {
  border-color: color-mix(in srgb, var(--ac) 45%, var(--border));
  box-shadow: 0 10px 30px rgba(15,23,42,.10), 0 2px 8px color-mix(in srgb, var(--ac) 14%, transparent);
  transform: translateY(-3px);
}
.ag-card:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

.ag-card-top { display: flex; align-items: center; gap: 11px; }

/* the "face" — a coloured tile with the role glyph and the initials under it */
.ag-face {
  position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--ac), color-mix(in srgb, var(--ac) 62%, #0b1a12));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ac) 34%, transparent);
}
.ag-face svg { width: 20px; height: 20px; }
.ag-face b {
  position: absolute; right: -3px; bottom: -3px;
  font-size: 8.5px; font-weight: 800; letter-spacing: .3px;
  background: var(--surf); color: var(--ac);
  border: 1px solid color-mix(in srgb, var(--ac) 26%, var(--border));
  border-radius: 6px; padding: 1px 4px; line-height: 1.35;
}

.ag-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ag-name {
  font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ag-role { font-size: 11px; color: var(--ink3); font-weight: 600; }

.ag-health {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  color: var(--hc); background: color-mix(in srgb, var(--hc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--hc) 26%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.ag-health i { width: 6px; height: 6px; border-radius: 50%; background: var(--hc); }

.ag-desc {
  font-size: 12px; line-height: 1.5; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.ag-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
/* the label is the span's own text; the value is the <b> inside it */
.ag-stats span {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink4);
}
.ag-stats b {
  font-size: 14px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
  text-transform: none; letter-spacing: 0;  /* "1m 4s", not "1M 4S" */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* A timer trigger's card carries three facts, not four, and the first of them
   is a phrase ("daily at 10:00 and 11:00 UTC") rather than a number. In the
   even 4-column grid it ellipsed to "daily at 10…", which loses the only part
   worth reading. Three columns, widest first. */
.ag-stats--timer { grid-template-columns: 1.5fr 1fr .75fr; }
.ag-stats--timer b { font-size: 12.5px; }

/* success / failure / cancelled proportions */
.ag-bar { display: flex; height: 4px; border-radius: 3px; overflow: hidden; background: var(--border-s); }
.ag-bar i { display: block; min-width: 0; }
.ag-bar .ok { background: #16a34a; }
.ag-bar .fail { background: #dc2626; }
.ag-bar .cx { background: #cbd5e1; }

.ag-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ag-last { font-size: 10.5px; color: var(--ink3); font-weight: 600; white-space: nowrap; }

.ag-spark { display: flex; align-items: flex-end; gap: 2px; height: 20px; flex: 1; max-width: 150px; }
.ag-spark i { flex: 1; min-width: 2px; border-radius: 1.5px; background: var(--ac); display: block; }

@media (max-width: 520px) {
  .ag-grid { grid-template-columns: 1fr; }
  .ag-stats { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
}

/* ── profile popup ── */
.ag-hero { height: 118px; }
.ag-hero-face {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32); color: #fff;
}
.ag-hero-face svg { width: 27px; height: 27px; }
.ag-modal .rm-hero-txt h2 { font-size: 19px; line-height: 1.25; }
/* .slug is styled as a repo slug (monospace) in the library modal — here it
   holds a job title, and the hero stats hold sentences, so undo both. */
.ag-modal .rm-hero-txt .slug { font-family: var(--f); font-size: 12.5px; font-weight: 600; opacity: .95; }
/* the library modal hangs a copy-to-clipboard glyph off .slug; a job title
   isn't a repo slug, so there is nothing to copy here */
.ag-modal .rm-hero-txt .slug::after { content: none; }
.ag-modal .rm-hero-stats span { text-transform: none; }

.ag-warn {
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid #fecaca; background: #fef2f2; border-radius: 12px; padding: 11px 13px;
}
.ag-warn b { font-size: 12.5px; font-weight: 800; color: #b91c1c; }
.ag-warn span { font-size: 11.5px; color: #7f1d1d; line-height: 1.5; }
.ag-warn--soft { border-color: #fde68a; background: #fffbeb; }
.ag-warn--soft b { color: #92400e; }
.ag-warn--soft span { color: #78350f; }

.ag-cost-hero {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 0 16px; border: 1px solid var(--border-s); border-radius: 14px;
  background: linear-gradient(180deg, #f0fdf9, var(--surf));
}
.ag-cost-hero .v { font-size: 34px; font-weight: 800; color: #0f766e; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ag-cost-hero .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink3); }

.ag-repo-row { cursor: pointer; }
.ag-repo-row:hover { background: #f8fafc; }
.ag-repo-row .when { color: var(--c-blue); font-weight: 700; }
