/*
 * Agents list, in the look of board 10 "Agents list, visual exploration"
 * (Agent Builder v6 canvas). Sizes are the board's, colours are --ag-* tokens.
 * Inter throughout, like the board.
 */

.inset[data-surface="list"] {
  background: var(--ag-page);
}
.inset[data-surface="list"] .main__inner {
  max-width: 1200px;
}

.ag-page {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 34px 0 40px;
  font-family: var(--font-ui);
  line-height: normal; /* the board's spacing: Inter's own line height */
  color: var(--ag-ink);
}

/* ---------- title row ---------- */
.ag-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.ag-head__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ag-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ag-ink);
}
.ag-sub {
  font-size: 15px;
  color: var(--ag-muted);
}
.ag-create {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  background: var(--ag-dark);
  color: var(--ag-dark-ink);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.ag-create:hover {
  opacity: 0.88;
}

/* ---------- summary tiles: a white frame around a soft inner panel ---------- */
.ag-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.ag-tile {
  padding: 6px;
  border-radius: 18px;
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
}
.ag-tile__in {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 13px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.ag-tile__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ag-tile__icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
}
.ag-tile__icon--blue { color: var(--ag-i-blue); }
.ag-tile__icon--green { color: var(--ag-i-green); }
.ag-tile__icon--violet { color: var(--ag-i-violet); }
.ag-tile__icon--amber { color: var(--ag-i-amber); }
.ag-tile__label {
  font-size: 14px;
  color: var(--ag-ink-2);
}
.ag-tile__value {
  padding-inline-start: 2px;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- tabs ---------- */
.ag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ag-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ag-ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.ag-tab:hover {
  background: var(--ag-hover);
}
.ag-tab[aria-selected="true"] {
  background: var(--ag-dark);
  color: var(--ag-dark-ink);
}

/* tabs, and the layout switcher on the right */
.ag-tabs-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ag-layout {
  margin-inline-start: auto;
}

/* ---------- agent cards ---------- */
.ag-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ag-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* the whole card opens the agent */
.ag-list .ag-card {
  cursor: pointer;
}
.ag-list .ag-card:hover {
  border-color: var(--ag-btn-line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.ag-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ag-card__name {
  margin: 0;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-card__name a {
  color: inherit;
  text-underline-offset: 4px;
}
.ag-card__name a:hover {
  text-decoration: underline;
}
.ag-card__grow {
  flex: 1;
}

.ag-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ag-on-colour);
}
.ag-chip--live { background: var(--ag-live); }
.ag-chip--test { background: var(--ag-test); }
.ag-chip--draft {
  background: var(--ag-draft);
  color: var(--ag-draft-ink);
}
.ag-chip__v {
  opacity: 0.8;
  font-weight: 500;
}
/* Live: a small white dot before the word; Paused: a pause mark */
.ag-chip__dot {
  width: 6px;
  height: 6px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ag-chip__icon {
  margin-inline-end: 5px;
}

.ag-icon-btn,
.ag-btn {
  flex: none;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--ag-btn-line);
  background: var(--ag-card);
  color: var(--ag-ink);
  transition: background 0.15s ease, opacity 0.15s ease;
}
.ag-icon-btn {
  width: 38px;
}
.ag-btn {
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.ag-icon-btn:hover,
.ag-btn:hover {
  background: var(--ag-hover);
}
.ag-btn--dark {
  background: var(--ag-dark);
  border-color: var(--ag-dark);
  color: var(--ag-dark-ink);
}
.ag-btn--dark:hover {
  background: var(--ag-dark);
  opacity: 0.88;
}
.ag-more {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ag-muted);
}
.ag-more:hover,
.ag-more[aria-expanded="true"] {
  background: var(--ag-hover);
}

/* three soft boxes: voice · models and cost · channels and numbers */
.ag-wells {
  display: flex;
  gap: 12px;
}
.ag-well {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.ag-well--voice { flex: 1.1; }
.ag-well--models { flex: 1; }
.ag-well--channels { flex: 1.2; }
.ag-well__label {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ag-faint);
}

.ag-voice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ag-voice__pic {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
}
.ag-voice__play {
  position: absolute;
  inset-inline-end: -3px;
  bottom: -3px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ag-dark);
  color: var(--ag-dark-ink);
  border: 2px solid var(--ag-well);
}
.ag-voice__play svg {
  width: 9px;
  height: 9px;
}
.ag-voice__play .voice-play__icon {
  transform: translateX(0.5px);
}
/* the voice's person over a soft gradient */
.ag-face {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ag-g1);
}
.ag-face[data-tone="2"] { background: var(--ag-g2); }
.ag-face[data-tone="3"] { background: var(--ag-g3); }
.ag-face[data-tone="4"] { background: var(--ag-g4); }
.ag-face[data-tone="5"] { background: var(--ag-g5); }
.ag-face[data-tone="6"] { background: var(--ag-g6); }
.ag-face[data-tone="7"] { background: var(--ag-g7); }
.ag-face[data-tone="8"] { background: var(--ag-g8); }
/* the person sits at the bottom, a little smaller, so the colour shows round the head */
.ag-face img {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 90%;
  height: 90%;
  object-fit: cover;
  object-position: top;
  transform: translateX(-50%);
}
/* the voice avatars (assets/voices/avatar, 6 Oct 2026) are whole round portraits with their own colour: they fill the circle */
.ag-face img[src*="voices/avatar/"] {
  inset: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-position: center;
  transform: none;
}
.ag-voice__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-voice__name {
  font-size: 15px;
  font-weight: 500;
}
.ag-voice__detail {
  font-size: 12.5px;
  color: var(--ag-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.ag-lang svg {
  color: var(--ag-muted);
}

.ag-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}
.ag-kv__k {
  color: var(--ag-muted);
  white-space: nowrap;
}
.ag-kv__v {
  min-width: 0;
  font-weight: 500;
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-chan {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.ag-chan__dot {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ag-on-colour);
}
.ag-chan__dot svg {
  width: 13px;
  height: 13px;
}
.ag-chan__cut {
  fill: var(--ag-whatsapp-cut);
}
.ag-chan__dot--phone {
  background: var(--ag-phone-bg);
  color: var(--ag-phone-ink);
}
.ag-chan__dot--whatsapp {
  background: var(--ag-whatsapp-bg);
  color: var(--ag-whatsapp-ink);
}
.ag-chan__name {
  flex: 1;
  min-width: 0;
}
.ag-chan__num {
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ag-chan__num.is-none {
  color: var(--ag-faint);
}

/* results (Live, On test) and build progress (Draft) */
.ag-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* the three results sit under the three boxes above (same widths and gap) */
.ag-stats {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  column-gap: 12px;
  row-gap: 18px;
}
.ag-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ag-stat__value {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ag-stat__value.is-red {
  color: var(--ag-red);
}
.ag-stat__caption {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  color: var(--ag-muted);
  white-space: nowrap;
}
.ag-stat__ctext {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the info icon beside a number's label: its tooltip says what the number means */
.ag-info {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ag-faint);
  transition: color 0.15s ease, background 0.15s ease;
}
.ag-info:hover,
.ag-info:focus-visible {
  color: var(--ag-ink);
  background: var(--ag-hover);
}
/* on the summary tiles the info icon sits in the top corner, leaving the label its width */
.ag-tile__in {
  position: relative;
}
.ag-tile__head .ag-info {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
}
.ag-stat__extra {
  color: var(--ag-faint);
}
.ag-stat__spacer {
  display: block;
  height: 4px;
  margin-top: 10px;
}
.ag-bar {
  display: block;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--ag-track);
  overflow: hidden;
}
.ag-bar--flat {
  margin-top: 0;
}
.ag-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ag-dark);
}
.ag-bar--flat .ag-bar__fill {
  border-radius: 0;
}
.ag-bar__fill.is-red {
  background: var(--ag-red);
}

/* the next version waiting on the test numbers */
.ag-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--ag-well-line);
  background: var(--ag-well);
}
.ag-note__text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ag-ink-2);
}
.ag-note__text b {
  font-weight: 500;
  color: var(--ag-ink);
}

/* who made it */
.ag-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--ag-rule);
  font-size: 13.5px;
  color: var(--ag-muted);
}
.ag-foot__who {
  font-weight: 500;
  color: var(--ag-ink);
}
.ag-foot__dot {
  color: var(--ag-dot);
}

/* a person's round photo, initials underneath until it loads */
.person {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ag-draft);
}
.person__initials {
  font-size: 11px;
  font-weight: 600;
  color: var(--ag-ink);
}
.person img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ag-none {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
  color: var(--ag-muted);
}

/* empty project */
.ag-empty {
  align-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
}
.ag-empty__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-line);
  color: var(--ag-ink-2);
}
.ag-empty__title {
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
}
.ag-empty__text {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ag-muted);
}

/* ---------- Option 2: compact cards (board 12) ---------- */
.ag-card--compact {
  padding: 22px 26px;
}
.ag-card--compact .ag-card__head {
  gap: 10px;
}
.ag-card--compact .ag-card__name {
  font-size: 18px;
  letter-spacing: -0.01em;
}
.ag-cstats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 36px;
  row-gap: 18px;
}
.ag-cstats .ag-stat__value {
  font-size: 21px;
}
.ag-cstats .ag-bar,
.ag-cstats .ag-stat__spacer {
  margin-top: 12px;
}
.ag-cstats--draft {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ag-stat__line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ag-stat__line .ag-stat__caption {
  margin-top: 0;
}

.ag-sets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ag-set {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding-block: 0;
  padding-inline: 6px 12px;
  border-radius: 10px;
  background: var(--ag-set);
  border: 1px solid var(--ag-set-line);
  font-size: 13.5px;
  white-space: nowrap;
}
.ag-set__name {
  font-weight: 500;
}
.ag-set__sub {
  color: var(--ag-faint);
}
.ag-set__face .ag-face {
  width: 24px;
  height: 24px;
}
.ag-chip-ico {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ag-card);
  border: 1px solid var(--ag-btn-line);
  color: var(--ag-muted);
}
.ag-set--note {
  padding: 0 12px;
  background: var(--ag-well);
  border-color: var(--ag-well-line);
  color: var(--ag-ink-2);
  font-weight: 500;
}
.ag-edited {
  font-size: 13px;
  color: var(--ag-faint);
  white-space: nowrap;
}

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .ag-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ag-cstats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ag-wells {
    flex-wrap: wrap;
  }
  .ag-well {
    flex: 1 1 260px;
  }
}
@media (max-width: 640px) {
  .ag-page {
    padding-top: 16px;
    gap: 20px;
  }
  .ag-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ag-create {
    justify-content: center;
  }
  .ag-tiles {
    gap: 10px;
  }
  .ag-tile__in {
    padding: 14px;
  }
  .ag-tile__value {
    font-size: 24px;
  }
  .ag-card {
    padding: 18px 16px;
  }
  .ag-card__head {
    flex-wrap: wrap;
  }
  .ag-card__name {
    flex: 1 1 100%;
    white-space: normal;
  }
  .ag-stats {
    grid-template-columns: 1fr;
  }
  .ag-cstats,
  .ag-cstats--draft {
    grid-template-columns: 1fr;
  }
  .ag-note {
    flex-direction: column;
    align-items: stretch;
  }
}

/* call direction (V1): a quiet chip beside the channel chips */
.ag-well__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ag-dir {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--ag-btn-line);
  background: var(--ag-card);
  font-size: 12px;
  font-weight: 500;
  color: var(--ag-ink-2);
  white-space: nowrap;
}
.ag-dir svg {
  color: var(--ag-muted);
}

/* an agent's open alerts, beside its status chip (board 18H): red bell and edge, words in red */
.al-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--ag-red) 40%, var(--ag-line));
  background: var(--ag-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ag-red);
  white-space: nowrap;
  text-decoration: none;
}
.al-chip:hover {
  background: color-mix(in srgb, var(--ag-red) 6%, var(--ag-card));
}

