/* Enterprise agent portraits and illustrative profile dialogs. */
.af-section {
  padding-block: var(--space-16);
  background: var(--color-sky);
  color: var(--color-ink);
  border-block-start: var(--rule-thin) solid var(--color-sky-rule);
}
.af-heading { text-align: center; }
.af-intro {
  margin: var(--space-3) auto 0;
  font-size: var(--text-lead);
  line-height: 1.45;
}
.af-preview {
  margin: var(--space-4) auto 0;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-label);
  letter-spacing: normal;
}
.af-cue {
  margin: var(--space-8) auto var(--space-4);
  color: var(--color-body);
  font-size: var(--text-small);
  text-align: center;
}
.af-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(10rem, 19vw, 11.5rem);
  align-items: start;
  gap: var(--space-5);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: var(--space-2) var(--space-2) var(--space-5);
  scroll-snap-type: inline proximity;
  scrollbar-color: var(--color-sky-rule) var(--color-clear);
  scrollbar-width: thin;
}
.af-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--color-ink);
  background: var(--color-clear);
  text-align: center;
  scroll-snap-align: start;
}
.af-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  flex: none;
  border-radius: var(--radius-small);
  background-color: var(--color-paper-sunken);
  background-image: url("../assets/agents/enterprise-portraits.webp");
  background-size: 300% 200%;
  background-position: var(--portrait-x, 0%) var(--portrait-y, 0%);
  background-repeat: no-repeat;
}
.af-agent[aria-expanded="true"] .af-portrait {
  outline: 3px solid var(--color-hero-amber);
  outline-offset: 2px;
}
.af-agent:focus-visible { border-radius: var(--radius-small); }
.af-name {
  display: block;
  max-width: 100%;
  margin-block-start: var(--space-3);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.af-specialty {
  display: block;
  margin-block-start: var(--space-1);
  color: var(--color-body);
  font-size: var(--text-small);
  line-height: 1.4;
}
.af-dialog {
  --af-bg: #0b1011;
  --af-surface: #182024;
  --af-rule: #2c3539;
  --af-text: #f5f5f1;
  --af-muted: #b4bfc5;
  --af-blue: #86b6ff;
  --af-gold: #ffc263;
  --color-focus: var(--af-gold);
  color-scheme: dark;

  width: min(48.75rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 3rem);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: var(--rule-thin) solid var(--af-rule);
  border-radius: var(--radius-large);
  background: var(--af-bg);
  color: var(--af-text);
  font-family: var(--font-body);
}
.af-dialog .af-portrait { background-color: var(--af-surface); }
.af-dialog ::selection { background: var(--af-gold); color: var(--af-bg); }
.af-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.af-modal { position: relative; padding: var(--space-8); }
.af-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding-inline-end: var(--space-10);
}
.af-profile-portrait { width: 6rem; border-radius: 50%; }
.af-profile-copy { min-width: 0; }
.af-profile-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}
.af-profile-version { white-space: nowrap; }
.af-profile-name {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: normal;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.af-profile-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-block-start: var(--space-2);
  color: var(--af-muted);
  font-size: var(--text-small);
  overflow-wrap: anywhere;
}
.af-profile-badge {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--af-surface);
  color: var(--af-blue);
  font-size: var(--text-small);
  margin-block-end: var(--space-2);
}
.af-profile-team { margin-block-start: var(--space-2); color: var(--af-muted); font-size: var(--text-small); }
.af-profile-purpose { margin-block-start: var(--space-5); color: var(--af-muted); font-size: var(--text-small); }
.af-close {
  position: absolute;
  inset-block-start: var(--space-4);
  inset-inline-end: var(--space-4);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--af-text);
  background: transparent;
}
.af-icon, .af-file-icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.af-tablist, .af-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-1);
  margin-block: var(--space-6);
  padding: var(--space-1);
  border: var(--rule-thin) solid var(--af-rule);
  border-radius: var(--radius-pill);
}
.af-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: 44px;
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--af-text);
  font-size: var(--text-small);
  line-height: 1.3;
}
.af-tab[aria-selected="true"] { background: var(--af-surface); color: var(--af-blue); font-weight: 650; }
.af-tab-panel {
  border-block-start: var(--rule-thin) solid var(--af-rule);
  padding-block-start: var(--space-5);
  min-height: 16rem;
}
.af-panel-heading { font-family: var(--font-body); font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: normal; }
.af-panel-description { margin-block-start: var(--space-1); color: var(--af-muted); font-size: var(--text-small); }
.af-record-list { list-style: none; padding: 0; margin: var(--space-5) 0 0; }
.af-record {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-block-end: var(--rule-thin) solid var(--af-rule);
}
.af-record:first-child { padding-block-start: 0; }
.af-record-copy { min-width: 0; }
.af-record-title { display: block; margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.af-record-meta { margin-block-start: var(--space-1); color: var(--af-muted); font-size: var(--text-small); }
.af-status {
  display: inline-block;
  flex: none;
  max-width: 9rem;
  padding: var(--space-1) var(--space-2);
  border: var(--rule-thin) solid var(--af-rule);
  border-radius: var(--radius-small);
  color: var(--af-muted);
  background: var(--af-surface);
  font-size: var(--text-label);
  line-height: 1.4;
}
.af-file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-block-start: var(--space-5); }
.af-file {
  min-width: 0;
  border: var(--rule-thin) solid var(--af-rule);
  border-radius: var(--radius-card);
  background: var(--af-surface);
}
.af-file > summary {
  display: flex;
  align-items: start;
  gap: var(--space-3);
  min-height: 88px;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  cursor: pointer;
  list-style: none;
}
.af-file > summary::-webkit-details-marker { display: none; }
.af-file > summary::after { content: "+"; margin-inline-start: auto; color: var(--af-muted); }
.af-file[open] > summary::after { content: "−"; }
.af-file-title { display: block; font-weight: 650; font-size: var(--text-small); overflow-wrap: anywhere; }
.af-file-copy { min-width: 0; }
.af-file-description { display: block; margin-block-start: var(--space-1); color: var(--af-muted); font-weight: 400; font-size: var(--text-small); line-height: 1.4; }
.af-file-icon { width: 26px; height: 30px; }
.af-file-content { margin: 0 var(--space-4) var(--space-4); color: var(--af-muted); font-size: var(--text-small); line-height: 1.6; }
.af-skill-list { margin: 0 var(--space-4) var(--space-4); padding-inline-start: var(--space-5); font-size: var(--text-small); line-height: 1.65; }
.af-footer { margin-block-start: var(--space-6); padding-block-start: var(--space-4); border-block-start: var(--rule-thin) solid var(--af-rule); color: var(--af-muted); font-size: var(--text-label); line-height: 1.5; text-align: center; }

.af-growth {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-block-start: var(--space-5);
  padding-block-end: var(--space-5);
  border-block-end: var(--rule-thin) solid var(--af-rule);
}
.af-growth-label {
  color: var(--af-muted);
  font-family: var(--font-body);
  font-size: var(--text-label);
  line-height: 1.5;
  letter-spacing: normal;
}
.af-profile-version, .af-growth-version {
  padding: var(--space-1) var(--space-3);
  border: var(--rule-thin) solid var(--af-rule);
  border-radius: var(--radius-small);
  background: var(--af-surface);
  color: var(--af-blue);
  font-size: var(--text-small);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.af-growth-source { flex-basis: 100%; color: var(--af-muted); font-size: var(--text-small); line-height: 1.5; }
.af-growth-list { list-style: none; margin: 0; padding: 0; }
.af-growth-record { padding-block: var(--space-5); border-block-end: var(--rule-thin) solid var(--af-rule); }
.af-growth-record:last-child { border-block-end: 0; padding-block-end: 0; }
.af-growth-title { margin: var(--space-2) 0 0; color: var(--af-text); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.af-growth-copy { margin-block-start: var(--space-2); color: var(--af-muted); font-size: var(--text-small); line-height: 1.6; }

@media (hover: hover) and (pointer: fine) {
  .af-agent:hover .af-portrait { outline: 2px solid var(--color-amber-deep); outline-offset: 2px; }
  .af-close:hover, .af-tab:hover { background: var(--af-surface); }
  .af-file > summary:hover { background: var(--af-surface); }
}
@media (min-width: 60rem) { .af-section { padding-block: var(--space-20); } }
@media (min-width: 70rem) {
  .af-row { grid-auto-flow: initial; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-5); }
}
@media (max-width: 48rem) {
  .af-tablist, .af-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: var(--radius-card); }
  .af-tab { flex-direction: column; gap: var(--space-1); border-radius: var(--radius-small); font-size: var(--text-small); }
  .af-tab .af-icon { width: 22px; height: 22px; }
}
@media (max-width: 40rem) {
  .af-modal { padding: var(--space-5); }
  .af-profile-header { gap: var(--space-3); padding-inline-end: var(--space-6); }
  .af-profile-portrait { width: 4.5rem; }
  .af-close { inset-block-start: var(--space-2); inset-inline-end: var(--space-2); }
  .af-file-grid { grid-template-columns: minmax(0, 1fr); }
  .af-record { flex-direction: column; gap: var(--space-2); }
  .af-profile-meta { gap: var(--space-2); }
}
