:root {
  --agent-base: var(--cp-bg-2);
  --agent-raised: var(--cp-bg);
  --agent-inset: var(--cp-bg-3);
  --agent-ink: var(--cp-ink);
  --agent-text: var(--cp-text);
  --agent-muted: var(--cp-muted);
  --agent-line: var(--cp-border-2);
  --agent-brand: var(--cp-navy);
  --agent-brand-deep: var(--cp-navy-deep);
  --agent-action: var(--cp-red);
  --agent-action-hover: var(--cp-red-600);
  --agent-success: var(--cp-green);
  --agent-danger: var(--cp-red-600);
  --agent-white: var(--cp-bg);
  --agent-shadow: var(--cp-sh);
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 0;
  left: 16px;
  z-index: 100;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  color: var(--agent-white);
  background: var(--agent-brand-deep);
  border-radius: 0 0 8px 8px;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); outline: 3px solid var(--agent-action); outline-offset: 2px; }

html { min-width: 0; background: var(--agent-base); }
.agent-body {
  min-height: 100vh;
  min-width: 0;
  overflow-x: clip;
  background:
    linear-gradient(90deg, transparent 0 49.93%, color-mix(in srgb, var(--agent-line) 42%, transparent) 49.93% 50.07%, transparent 50.07%) top center / 96px 100% fixed,
    var(--agent-base);
  color: var(--agent-text);
}

.agent-clipboard-fallback {
  position: fixed;
  left: -10000px;
  opacity: 0;
  pointer-events: none;
}

.agent-fonts-pending .agent-font-guard { opacity: 0; }
.agent-font-guard { opacity: 1; transition: opacity .42s var(--cp-ease); }

.agent-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 76px;
  padding: 14px clamp(20px, 4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  background: color-mix(in srgb, var(--agent-white) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--agent-line) 80%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
}

.agent-brand { display: inline-flex; align-items: center; min-height: 44px; }
.agent-brand img { width: 176px; height: 44px; object-fit: contain; }
.agent-header__right,
.agent-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.agent-profile > span {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--agent-ink);
  font-size: 14px;
  font-weight: 700;
}

.agent-security {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-pill);
  color: var(--agent-brand);
  background: var(--agent-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.agent-security > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--agent-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--agent-success) 14%, transparent);
}

.agent-state {
  min-height: calc(100vh - 150px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--agent-muted);
  font-size: 14px;
  font-weight: 600;
}
.agent-state--error {
  padding: 32px 20px;
  text-align: center;
}
.agent-state--error h1 {
  margin: 0;
  color: var(--agent-ink);
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -.03em;
}
.agent-state--error p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}
.agent-state__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--agent-white);
  background: var(--agent-danger);
  font-size: 24px;
  font-weight: 800;
}
.agent-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.agent-loader { display: flex; gap: 7px; }
.agent-loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--agent-brand); animation: agent-load 1s ease-in-out infinite alternate; }
.agent-loader span:nth-child(2) { animation-delay: .16s; }
.agent-loader span:nth-child(3) { animation-delay: .32s; }
@keyframes agent-load { to { opacity: .25; transform: translateY(-5px); } }

.agent-auth {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 92px) 0;
  scroll-margin-top: 92px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .7fr);
  gap: clamp(42px, 8vw, 112px);
  align-items: center;
}
.agent-auth__message { min-width: 0; animation: agent-fade-up .6s var(--cp-ease) backwards; }
.agent-auth__message h1,
.agent-welcome h1 {
  margin: 0;
  color: var(--agent-ink);
  font-size: clamp(44px, 6.3vw, 84px);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 800;
  text-wrap: balance;
}
.agent-auth__message h1 span,
.agent-welcome h1 span { color: var(--agent-action); }
.agent-auth__message > p {
  max-width: 570px;
  margin: 24px 0 0;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}
.agent-auth__recovery-link,
.agent-auth__back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 14px;
  padding: 8px 0;
  border: 0;
  color: var(--agent-brand);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.agent-auth__recovery-link:hover,
.agent-auth__back-link:hover { color: var(--agent-action); }
.agent-auth__recovery-form { margin-top: 18px; }
.agent-auth__recovery-note {
  margin: 0;
  color: var(--agent-muted);
  font-size: 13px;
  line-height: 1.55;
}
.agent-auth__recovery-form .agent-form-status { margin-top: 0; }
.agent-auth__recovery-form button[disabled] { cursor: not-allowed; opacity: .58; }
.agent-kicker {
  display: inline-flex;
  margin: 0 0 16px;
  color: var(--agent-action);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ---- "Your Chance" brand mark ---- */
.agent-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.agent-kicker--chance {
  position: relative;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
  padding: 11px 20px 11px 16px;
  overflow: hidden;
  background: linear-gradient(115deg, var(--cp-red-soft) 0%, var(--agent-white) 78%);
  border: 1px solid color-mix(in srgb, var(--agent-action) 24%, var(--agent-white));
  border-radius: var(--cp-r-pill);
  box-shadow: 0 14px 30px -18px rgba(224, 36, 28, .55);
  font-size: clamp(14px, 1.5vw, 17px);
  letter-spacing: .21em;
}
.agent-kicker--chance::after {
  content: "";
  position: absolute;
  top: -40%;
  left: 0;
  width: 34%;
  height: 180%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .85), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: agent-chance-gleam 4.6s var(--cp-ease) 1.4s infinite;
  pointer-events: none;
}
.agent-chance-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--agent-action);
}
.agent-chance-word { display: inline-flex; color: var(--agent-ink); }
.agent-chance-word--accent { color: var(--agent-action); }
.agent-chance-word span {
  display: inline-block;
  animation: agent-chance-rise .5s var(--cp-ease) backwards;
}
.agent-chance-word:not(.agent-chance-word--accent) span:nth-child(1) { animation-delay: .08s; }
.agent-chance-word:not(.agent-chance-word--accent) span:nth-child(2) { animation-delay: .13s; }
.agent-chance-word:not(.agent-chance-word--accent) span:nth-child(3) { animation-delay: .18s; }
.agent-chance-word:not(.agent-chance-word--accent) span:nth-child(4) { animation-delay: .23s; }
.agent-chance-word--accent span:nth-child(1) { animation-delay: .34s; }
.agent-chance-word--accent span:nth-child(2) { animation-delay: .39s; }
.agent-chance-word--accent span:nth-child(3) { animation-delay: .44s; }
.agent-chance-word--accent span:nth-child(4) { animation-delay: .49s; }
.agent-chance-word--accent span:nth-child(5) { animation-delay: .54s; }
.agent-chance-word--accent span:nth-child(6) { animation-delay: .59s; }
@keyframes agent-chance-rise {
  from { opacity: 0; transform: translateY(.6em); }
  to { opacity: 1; transform: none; }
}
@keyframes agent-chance-gleam {
  0%, 58% { transform: translateX(-160%) skewX(-18deg); }
  82%, 100% { transform: translateX(420%) skewX(-18deg); }
}
@keyframes agent-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-kicker--chance::after,
  .agent-chance-dot,
  .agent-chance-word span,
  .agent-auth__message,
  .agent-auth__card,
  .agent-welcome__copy,
  .agent-route-ticket,
  .agent-link-card { animation: none !important; }
}
.agent-assurance {
  max-width: 520px;
  margin-top: 34px;
  padding: 18px 0;
  display: flex;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--agent-line);
}
.agent-assurance > span {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--agent-success) 12%, var(--agent-white));
  color: var(--agent-success);
  font-weight: 800;
}
.agent-assurance strong,
.agent-assurance small { display: block; }
.agent-assurance strong { color: var(--agent-ink); font-size: 14px; }
.agent-assurance small { margin-top: 2px; color: var(--agent-muted); font-size: 13px; }

.agent-auth__card,
.agent-panel {
  min-width: 0;
  padding: clamp(26px, 4vw, 40px);
  background: var(--agent-raised);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-card);
  box-shadow: var(--agent-shadow);
}
.agent-auth__card { position: relative; animation: agent-fade-up .6s var(--cp-ease) .12s backwards; }
.agent-auth__card::before {
  content: "";
  position: absolute;
  inset: 0 32px auto;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--agent-brand) 0 72%, var(--agent-action) 72%);
}
.agent-auth__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--agent-brand);
  background: var(--agent-inset);
  border-radius: var(--cp-r-sm);
}
.agent-auth__icon svg { width: 24px; height: 24px; }
.agent-auth__card h2,
.agent-panel h3 {
  margin: 22px 0 8px;
  color: var(--agent-ink);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.agent-auth__card > p,
.agent-panel__head p { margin: 0; color: var(--agent-muted); font-size: 14px; line-height: 1.55; }
.agent-panel__head h3 { margin-top: 0; }

.agent-form { display: grid; gap: 18px; margin-top: 26px; }
.agent-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--agent-ink);
  font-size: 13px;
  font-weight: 700;
}
.agent-form input,
.agent-form select,
.agent-team-row input,
.agent-team-row select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--agent-ink);
  background: var(--agent-white);
  border: 1px solid var(--agent-line);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.agent-form input:focus,
.agent-form select:focus,
.agent-team-row input:focus,
.agent-team-row select:focus {
  border-color: var(--agent-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--agent-brand) 15%, transparent);
}
.agent-form-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agent-terms-set { margin: 0; padding: 0; border: 0; }
.agent-terms-set[hidden] { display: none; }
.agent-form-section-heading { grid-column: 1 / -1; margin-top: 8px; color: var(--agent-brand); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agent-form-status,
.agent-page-status {
  min-height: 22px;
  margin: 0;
  color: var(--agent-muted);
  font-size: 13px;
  line-height: 1.5;
}
.agent-form-status.is-error,
.agent-page-status.is-error { color: var(--agent-danger); }
.agent-form-status.is-success,
.agent-page-status.is-success { color: var(--agent-success); }

.agent-btn {
  min-width: 0;
  min-height: 46px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.agent-btn:hover:not(:disabled) { transform: translateY(-1px); }
.agent-btn:active:not(:disabled) { transform: translateY(0); }
.agent-btn:focus-visible,
.agent-tabs button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--agent-brand) 38%, transparent);
  outline-offset: 3px;
}
.agent-btn--primary { color: var(--agent-white); background: var(--agent-brand); box-shadow: var(--cp-sh-navy); }
.agent-btn--primary:hover:not(:disabled) { background: var(--cp-navy-700); }
.agent-btn--quiet { color: var(--agent-brand); background: var(--agent-white); border-color: var(--agent-line); }
.agent-btn--quiet:hover:not(:disabled) { border-color: var(--agent-brand); background: var(--agent-inset); }
.agent-btn--danger { color: #9f1d20; background: #fff5f5; border-color: #f2c4c5; }
.agent-btn--danger:hover:not(:disabled) { color: #7f1518; background: #feecec; border-color: #dc8f92; }
.agent-btn--icon { min-width: 68px; color: var(--agent-brand); background: var(--agent-inset); border-color: var(--agent-line); }
.agent-btn--small { min-height: 40px; padding: 8px 13px; font-size: 12px; }
.agent-btn:disabled { color: var(--agent-muted); background: var(--agent-inset); border-color: var(--agent-line); box-shadow: none; cursor: not-allowed; opacity: .72; }

.agent-workspace { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: clamp(44px, 6vw, 82px) 0 80px; scroll-margin-top: 92px; }
.agent-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .38fr);
  gap: clamp(30px, 7vw, 90px);
  align-items: end;
}
.agent-welcome h1 { font-size: clamp(40px, 5vw, 68px); }
.agent-welcome__copy { animation: agent-fade-up .6s var(--cp-ease) backwards; }
.agent-welcome__copy > p { max-width: 670px; margin: 20px 0 0; font-size: 17px; line-height: 1.6; }
.agent-route-ticket {
  min-width: 0;
  position: relative;
  animation: agent-fade-up .6s var(--cp-ease) .14s backwards;
  padding: 24px 24px 22px;
  overflow: hidden;
  color: var(--agent-white);
  background: var(--agent-brand-deep);
  border-radius: var(--cp-r-md);
  box-shadow: var(--cp-sh-navy);
}
.agent-route-ticket span,
.agent-route-ticket strong,
.agent-route-ticket small { display: block; }
.agent-route-ticket span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cp-on-dark-mut);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.agent-route-ticket strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 20px; line-height: 1.25; }
.agent-route-ticket small { margin-top: 7px; color: var(--cp-on-dark); font-size: 12px; line-height: 1.45; }

.agent-tabs {
  margin: clamp(36px, 5vw, 62px) 0 0;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--agent-line);
}
.agent-tabs button {
  min-height: 44px;
  padding: 9px 15px;
  color: var(--agent-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--cp-r-pill);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.agent-tabs button:hover { transform: translateY(-1px); }
.agent-tabs button:hover { color: var(--agent-ink); background: var(--agent-white); }
.agent-tabs button.is-active { color: var(--agent-white); background: var(--agent-brand); box-shadow: var(--cp-sh-sm); }

.agent-section { padding-top: clamp(34px, 5vw, 60px); }
.agent-section__head { min-width: 0; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 28px; }
.agent-section__head .agent-kicker { margin-bottom: 10px; }
.agent-section__head h2 { margin: 0; color: var(--agent-ink); font-size: clamp(28px, 3vw, 40px); line-height: 1.08; letter-spacing: -.03em; }
.agent-section__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-section > .agent-page-status { margin: 12px 0 4px; }

/* Prepare an application: behind its button above the list (agent-portal.js). */
.agent-draft-panel { margin-top: 24px; scroll-margin-top: 92px; }
.agent-draft-panel__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.agent-draft-panel__head > div { min-width: 0; flex: 1 1 320px; }
.agent-draft-panel__head h3 { margin-top: 0; }
/* An application the partner switched off (agent-portal.js renderDraftTypes()). */
.agent-draft-type-hint { color: var(--agent-muted); font-size: 12px; font-weight: 600; line-height: 1.45; }

.agent-resource-library { margin-top: 24px; }
.agent-resource-library h3 { margin-top: 12px; }
.agent-resource-library > p { max-width: 680px; margin: 0; color: var(--agent-muted); font-size: 14px; line-height: 1.55; }
.agent-document-library {
  min-width: 0;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.agent-document-card {
  min-width: 0;
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--agent-ink);
  text-decoration: none;
  background: var(--agent-white);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.agent-document-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--agent-brand) 42%, var(--agent-line)); box-shadow: var(--cp-sh-sm); }
.agent-document-card:focus-visible { outline: 3px solid rgba(91, 139, 184, .45); outline-offset: 3px; }
.agent-document-card__head { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.agent-document-card__version { color: var(--agent-muted); font-size: 10px; font-weight: 700; }
.agent-document-card strong { font-size: 16px; line-height: 1.35; }
.agent-document-card p { margin: 0; color: var(--agent-muted); font-size: 12px; line-height: 1.5; }
.agent-document-card small { margin-top: auto; color: var(--agent-brand); font-size: 10px; font-weight: 750; }
.agent-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-top: 24px;
}
.agent-resource-card {
  min-width: 0;
  min-height: 96px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  color: var(--agent-ink);
  text-decoration: none;
  background: var(--agent-base);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.agent-resource-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--agent-brand) 42%, var(--agent-line)); box-shadow: var(--cp-sh-sm); }
.agent-resource-card span { color: var(--agent-muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.agent-resource-card strong { font-size: 15px; }
.agent-resource-card:focus-visible {
  outline: 3px solid rgba(91, 139, 184, .45);
  outline-offset: 3px;
}

.agent-link-grid { min-width: 0; margin-top: 24px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.agent-link-card {
  min-width: 0;
  grid-column: span 4;
  min-height: 310px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--agent-raised);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-md);
  box-shadow: var(--cp-sh-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  animation: agent-fade-up .55s var(--cp-ease) backwards;
}
.agent-link-card:nth-child(1) { animation-delay: .05s; }
.agent-link-card:nth-child(2) { animation-delay: .11s; }
.agent-link-card:nth-child(3) { animation-delay: .17s; }
.agent-link-card:nth-child(4) { animation-delay: .23s; }
.agent-link-card:nth-child(5) { animation-delay: .29s; }
.agent-link-card:nth-child(6) { animation-delay: .35s; }
.agent-link-card:nth-child(7) { animation-delay: .41s; }
/* The three application cards (Standard, Pre-Qualification, High Risk) share the first
   row. Targeted by class, not position, so adding a card never reflows the grid. */
.agent-link-card--featured { grid-column: span 4; min-height: 326px; }
.agent-link-card--tool { grid-column: span 6; min-height: 286px; background: color-mix(in srgb, var(--agent-brand) 4%, var(--agent-raised)); }
.agent-link-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 3px;
  background: var(--agent-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.agent-link-card:not(.is-disabled):hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--agent-brand) 34%, var(--agent-line)); box-shadow: var(--agent-shadow); }
.agent-link-card:not(.is-disabled):hover::after { transform: scaleX(1); }
.agent-link-card.is-disabled { background: color-mix(in srgb, var(--agent-inset) 65%, var(--agent-white)); box-shadow: none; }
.agent-link-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.agent-card-number { color: var(--agent-muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.agent-card-state { padding: 5px 9px; border-radius: var(--cp-r-pill); color: var(--agent-brand); background: var(--agent-inset); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agent-link-card.is-ready .agent-card-state { color: var(--agent-success); background: color-mix(in srgb, var(--agent-success) 10%, var(--agent-white)); }
.agent-link-card.is-disabled .agent-card-state { color: var(--agent-muted); }
/* Announced, not broken. Reads as a promise rather than as something an administrator
   forgot to configure, which is what the plain disabled treatment implies. */
.agent-link-card.is-coming-soon .agent-card-state {
  color: var(--agent-brand);
  background: color-mix(in srgb, var(--agent-brand) 10%, var(--agent-white));
}
.agent-card-icon {
  width: 46px;
  height: 46px;
  margin: 26px 0 18px;
  display: grid;
  place-items: center;
  color: var(--agent-brand);
  background: var(--agent-inset);
  border-radius: 12px;
  transition: color .2s var(--cp-ease), background .2s var(--cp-ease), transform .2s var(--cp-ease);
}
.agent-link-card:not(.is-disabled):hover .agent-card-icon {
  color: var(--agent-white);
  background: var(--agent-brand);
  transform: scale(1.06);
}
.agent-card-icon svg { width: 23px; height: 23px; }
.agent-card-icon [class^="icon-"],
.agent-card-icon [class*=" icon-"] { font-size: 23px; line-height: 1; }
.agent-link-card h3 { margin: 0; color: var(--agent-ink); font-size: 20px; line-height: 1.2; letter-spacing: -.015em; }
.agent-link-card > p { margin: 9px 0 24px; color: var(--agent-muted); font-size: 14px; line-height: 1.5; }
.agent-card-actions { min-width: 0; margin-top: auto; display: flex; flex-wrap: wrap; gap: 9px; }
.agent-card-actions [data-open] { flex: 1 1 150px; }
/* A card that is itself the link (Square Onboarding) draws its button as a span: it fills
   the row like every other card's button. */
.agent-card-actions > span.agent-btn { flex: 1 1 150px; }

.agent-admin-layout { min-width: 0; margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.agent-admin-layout--team { grid-template-columns: minmax(310px, .62fr) minmax(0, 1.38fr); }
.agent-panel { margin: 0; box-shadow: var(--cp-sh-sm); }
.agent-panel--note { color: var(--agent-white); background: var(--agent-brand-deep); border-color: var(--agent-brand-deep); }
.agent-panel--note .agent-card-number { color: var(--cp-on-dark-mut); }
.agent-panel--note h3 { max-width: 360px; margin-top: 14px; color: var(--agent-white); font-size: 27px; }
.agent-panel--note ol { margin: 24px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: step; list-style: none; }
.agent-panel--note li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; align-items: start; color: var(--cp-on-dark); font-size: 14px; line-height: 1.5; }
.agent-panel--note li::before { counter-increment: step; content: counter(step); width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--cp-dark-border); border-radius: 50%; color: var(--agent-white); font-size: 11px; font-weight: 800; }

.agent-temporary { min-width: 0; margin-top: 4px; padding: 15px; display: grid; gap: 8px; background: color-mix(in srgb, var(--agent-success) 8%, var(--agent-white)); border: 1px solid color-mix(in srgb, var(--agent-success) 28%, var(--agent-line)); border-radius: var(--cp-r-sm); }
.agent-temporary span { color: var(--agent-success); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agent-temporary strong { min-width: 0; overflow-wrap: anywhere; color: var(--agent-ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }

.agent-team-panel { min-width: 0; }
.agent-team-search { min-width: 0; display: grid; gap: 8px; margin-top: 20px; }
.agent-team-search > label { color: var(--agent-ink); font-size: 13px; font-weight: 700; }
.agent-team-search__controls { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.agent-team-search__controls input { flex: 1 1 180px; width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; color: var(--agent-ink); background: var(--agent-white); border: 1px solid var(--agent-line); border-radius: 10px; font: inherit; font-size: 15px; outline: none; }
.agent-team-search__controls input::placeholder { color: var(--agent-muted); opacity: 1; }
.agent-team-search__controls input:focus-visible { border-color: var(--agent-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--agent-brand) 15%, transparent); }
.agent-team-search > p { min-height: 20px; margin: 0; color: var(--agent-muted); font-size: 12px; line-height: 20px; }
.agent-team-list { min-width: 0; display: grid; gap: 10px; margin-top: 12px; }
.agent-team-row { min-width: 0; padding: 14px; display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(96px, .6fr) minmax(118px, .7fr) auto auto; gap: 10px; align-items: end; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: var(--cp-r-sm); }

/* ---- BluePrint access switch ---- */
.agent-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: var(--agent-base);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-sm);
}
.agent-access-row strong { display: block; color: var(--agent-ink); font-size: 13px; }
.agent-access-row small { display: block; margin-top: 2px; color: var(--agent-muted); font-size: 12px; line-height: 1.45; }
.agent-app-access { min-width: 0; margin: 0; padding: 15px; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: var(--cp-r-sm); }
.agent-app-access legend { padding: 0 5px; color: var(--agent-ink); font-size: 13px; font-weight: 800; }
.agent-app-access > p { margin: 0 0 12px; color: var(--agent-muted); font-size: 12px; line-height: 1.45; }
.agent-app-access__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.agent-app-access__grid label { min-width: 0; min-height: 48px; padding: 8px 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--agent-ink); background: var(--agent-white); border: 1px solid var(--agent-line); border-radius: 9px; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.agent-app-access__grid label > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.agent-app-access__grid .agent-switch { width: 38px; height: 22px; }
.agent-app-access__grid .agent-switch span { top: 3px; width: 16px; height: 16px; }
.agent-app-access__grid .agent-switch[aria-checked="true"] span { transform: translateX(16px); }
.agent-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  padding: 0;
  background: var(--cp-border-2);
  border: none;
  border-radius: var(--cp-r-pill);
  cursor: pointer;
  transition: background .18s ease;
}
.agent-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--agent-white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 26, 46, .25);
  transition: transform .18s var(--cp-ease);
}
.agent-switch[aria-checked="true"] { background: var(--agent-brand); }
.agent-switch[aria-checked="true"] span { transform: translateX(20px); }
.agent-switch:disabled { cursor: not-allowed; opacity: .55; }
.agent-switch:focus-visible { outline: 3px solid color-mix(in srgb, var(--agent-brand) 38%, transparent); outline-offset: 3px; }
.agent-team-row .agent-switch { margin-bottom: 9px; }
.agent-team-row__access { grid-column: 1 / -1; }
.agent-team-row__access .agent-switch { margin-bottom: 0; }
.agent-team-row label { min-width: 0; display: grid; gap: 5px; color: var(--agent-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agent-team-row .agent-app-access__grid { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.agent-team-row .agent-app-access__grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--agent-ink); letter-spacing: 0; text-transform: none; }
.agent-team-row input,
.agent-team-row select { min-height: 42px; padding: 8px 10px; background: var(--agent-white); font-size: 13px; }
.agent-team-row__identity { min-width: 0; align-self: center; }
.agent-team-row__identity strong,
.agent-team-row__identity small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-team-row__identity strong { color: var(--agent-ink); font-size: 14px; }
.agent-team-row__identity small { margin-top: 3px; color: var(--agent-muted); font-size: 11px; }
.agent-team-row__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.agent-team-row__group { grid-column: 1 / -1; max-width: 420px; }
.agent-team-row__identity small.agent-team-row__group-badge { display: inline-block; max-width: 100%; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: var(--agent-base); border: 1px solid var(--agent-line); color: var(--agent-ink); font-size: 10.5px; font-weight: 800; }
.agent-team-empty { padding: 28px 16px; text-align: center; color: var(--agent-muted); font-size: 14px; border: 1px dashed var(--agent-line); border-radius: var(--cp-r-sm); }

/* ---- My agents: an organization's saved agents, and the inline Agent pickers ---- */
.agent-org-agents { margin-top: 18px; }
.agent-org-agents[hidden],
.agent-form label[hidden],
.agent-org-agent-quick[hidden] { display: none; }
.agent-org-agent-list { min-width: 0; display: grid; gap: 8px; margin-top: 14px; }
.agent-org-agent-row { min-width: 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: var(--cp-r-sm); }
.agent-org-agent-row__identity { min-width: 0; }
.agent-org-agent-row__identity strong,
.agent-org-agent-row__identity small { display: block; min-width: 0; overflow-wrap: anywhere; }
.agent-org-agent-row__identity strong { color: var(--agent-ink); font-size: 14px; }
.agent-org-agent-row__identity small { margin-top: 3px; color: var(--agent-muted); font-size: 12px; }
.agent-org-agent-row__actions { display: flex; flex-wrap: wrap; gap: 7px; flex: none; }
.agent-org-agent-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--agent-line); }
.agent-org-agent-form h4 { margin: 0; color: var(--agent-ink); font-size: 16px; }
.agent-form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agent-org-agent-quick { min-width: 0; padding: 15px; display: grid; gap: 12px; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: var(--cp-r-sm); }
.agent-org-agent-quick .agent-form-help { margin: 0; color: var(--agent-muted); font-size: 12px; line-height: 1.45; }
.agent-org-agent-quick input { min-height: 42px; padding: 8px 10px; font-size: 14px; }
.agent-application-row__meta > span.agent-application-row__agent { color: var(--agent-ink); font-weight: 700; }

/* High Risk terms are a send-time decision, so a focused modal is the one place a
   dialog earns its interruption. The browser supplies focus trapping and Escape. */
.agent-dialog { width: min(calc(100% - 32px), 620px); max-height: min(90vh, 720px); padding: 0; overflow: auto; color: var(--agent-text); background: transparent; border: 0; border-radius: var(--cp-r-md); }
.agent-dialog::backdrop { background: rgba(10, 20, 36, .68); backdrop-filter: blur(4px); }
.agent-dialog__surface { margin: 0; padding: clamp(24px, 4vw, 34px); background: var(--agent-white); border: 1px solid var(--agent-line); border-radius: var(--cp-r-md); box-shadow: 0 32px 80px -24px rgba(10, 20, 36, .72); }
.agent-dialog__head .agent-kicker { margin-bottom: 9px; }
.agent-dialog__head h2 { margin: 0; color: var(--agent-ink); font-size: clamp(25px, 4vw, 34px); line-height: 1.1; letter-spacing: -.025em; }
.agent-dialog__head p { margin: 10px 0 22px; color: var(--agent-muted); font-size: 14px; line-height: 1.55; }
.agent-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.agent-reusable-link { display: grid; gap: 10px; margin: 0 0 18px; padding: 16px 18px; background: var(--agent-inset); border: 1px solid var(--agent-line); border-radius: var(--cp-r-sm, 10px); }
.agent-reusable-link h3 { margin: 0; color: var(--agent-ink); font-size: 16px; line-height: 1.3; }
.agent-reusable-link p { margin: 0; color: var(--agent-muted); font-size: 14px; line-height: 1.55; }
.agent-reusable-link .agent-btn { justify-self: start; max-width: 100%; white-space: normal; }
.agent-reusable-divider { margin: 0 0 14px; color: var(--agent-ink); font-size: 14px; font-weight: 700; }

.agent-application-layout {
  min-width: 0;
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}
.agent-application-panel,
.agent-application-detail { padding: clamp(22px, 3vw, 32px); }
/* "Back to applications" leads from the open application to the list above it, so it
   is shown only when the two are stacked (max-width: 980px, below). */
.agent-btn.agent-application-back { display: none; margin-bottom: 18px; gap: 7px; }
.agent-application-search { min-width: 0; margin-top: 18px; display: grid; gap: 7px; }
.agent-application-search > label { color: var(--agent-ink); font-size: 12px; font-weight: 800; }
.agent-application-search__control { min-width: 0; display: flex; gap: 7px; }
.agent-application-search input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--agent-ink);
  background: var(--agent-white);
  border: 1px solid var(--agent-line);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
}
.agent-application-search input:focus { outline: 3px solid color-mix(in srgb, var(--agent-brand) 24%, transparent); border-color: var(--agent-brand); }
.agent-application-search input::placeholder { color: var(--agent-muted); opacity: .86; }
.agent-application-search__control .agent-btn { flex: none; }
.agent-application-search > p { min-height: 16px; margin: 0; color: var(--agent-muted); font-size: 10px; line-height: 1.45; }

.agent-onboarding-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.agent-onboarding-form { display: flex; flex-direction: column; gap: 18px; }
.agent-onboarding-fields { border: 1px solid var(--agent-line); border-radius: 14px; padding: 18px; margin: 0; }
.agent-onboarding-fields legend { padding: 0 7px; font-weight: 800; color: var(--agent-ink); }
.agent-onboarding-fields > p { margin: 0 0 16px; color: var(--agent-muted); font-size: 12px; line-height: 1.5; }
#onboarding-template-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#onboarding-template-fields label { min-width: 0; }
#onboarding-template-fields label.is-wide { grid-column: 1 / -1; }
.agent-onboarding-created { border: 1px solid #b8dec8; border-radius: 13px; background: #eff9f3; padding: 16px; display: grid; gap: 10px; }
.agent-onboarding-created > span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: #247245; }
.agent-onboarding-created code { display: block; background: #fff; border: 1px solid #cce7d7; border-radius: 9px; padding: 10px; font-size: 11px; overflow-wrap: anywhere; color: var(--agent-ink); }
.agent-onboarding-created > div { display: flex; gap: 8px; flex-wrap: wrap; }
.agent-onboarding-invites { min-width: 0; }
.agent-onboarding-list { display: grid; gap: 12px; }
.agent-onboarding-row { border: 1px solid var(--agent-line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; background: #fff; }
.agent-onboarding-row__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.agent-onboarding-row__head strong { display: block; font-size: 14px; }
.agent-onboarding-row__head small { display: block; margin-top: 4px; color: var(--agent-muted); overflow-wrap: anywhere; }
.agent-onboarding-state { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #edf2f7; color: #53667b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.agent-onboarding-state.is-pending { background: #fff4db; color: #8a5a00; }
.agent-onboarding-state.is-submitted { background: #e6f7ed; color: #187344; }
.agent-onboarding-state.is-revoked,.agent-onboarding-state.is-expired { background: #f5e9e8; color: #9b342d; }
.agent-onboarding-row__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 11px; color: var(--agent-muted); }
.agent-onboarding-row__meta span { overflow-wrap: anywhere; }
.agent-onboarding-row__terms { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-onboarding-row__terms span { border-radius: 7px; background: #f2f5f8; padding: 5px 7px; font-size: 10px; color: #52677e; }
.agent-onboarding-row__actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--agent-line); padding-top: 11px; }
.agent-onboarding-sensitive { width: min(760px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); overflow: auto; }
.agent-onboarding-sensitive__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.agent-onboarding-sensitive__fields div { border: 1px solid var(--agent-line); border-radius: 10px; padding: 12px; min-width: 0; }
.agent-onboarding-sensitive__fields dt { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--agent-muted); }
.agent-onboarding-sensitive__fields dd { margin: 5px 0 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 900px) {
  .agent-onboarding-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  #onboarding-template-fields,.agent-onboarding-row__meta,.agent-onboarding-sensitive__fields { grid-template-columns: 1fr; }
  #onboarding-template-fields label.is-wide { grid-column: auto; }
}
.agent-application-list { min-width: 0; margin-top: 18px; display: grid; gap: 9px; }
.agent-application-more { width: 100%; margin-top: 12px; }
.agent-application-row {
  width: 100%;
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  color: var(--agent-text);
  text-align: left;
  background: var(--agent-base);
  border: 1px solid var(--agent-line);
  border-radius: var(--cp-r-sm);
  font: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.agent-application-row:hover,
.agent-application-row.is-selected { border-color: color-mix(in srgb, var(--agent-brand) 46%, var(--agent-line)); background: var(--agent-white); box-shadow: var(--cp-sh-sm); }
.agent-application-row:hover { transform: translateY(-1px); }
.agent-application-row:focus-visible { outline: 3px solid color-mix(in srgb, var(--agent-brand) 30%, transparent); outline-offset: 2px; }
.agent-application-row__head,
.agent-application-row__meta { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
/* A long business name or email address wraps inside its row (QA #19). */
.agent-application-row__head strong { min-width: 0; overflow-wrap: anywhere; color: var(--agent-ink); font-size: 14px; }
.agent-application-row__meta > span { min-width: 0; overflow-wrap: anywhere; }
.agent-application-row__head time,
.agent-application-row__meta > span:not(.agent-application-badge) { color: var(--agent-muted); font-size: 11px; }
.agent-application-row code,
.agent-application-reference { min-width: 0; overflow-wrap: anywhere; color: var(--agent-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.agent-application-badge {
  min-height: 25px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--cp-r-pill);
  color: var(--agent-muted);
  background: var(--agent-inset);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.agent-application-badge.is-delivered,
.agent-application-badge.is-verified { color: var(--agent-success); background: color-mix(in srgb, var(--agent-success) 10%, var(--agent-white)); }
.agent-application-badge.is-pending { color: var(--agent-danger); background: color-mix(in srgb, var(--agent-danger) 9%, var(--agent-white)); }
.agent-application-badge.is-decision-pending { color: #7b5a00; background: #fff7d6; }
.agent-application-badge.is-decision-approved { color: var(--agent-success); background: color-mix(in srgb, var(--agent-success) 10%, var(--agent-white)); }
.agent-application-badge.is-decision-declined { color: var(--agent-danger); background: color-mix(in srgb, var(--agent-danger) 9%, var(--agent-white)); }
.agent-application-badge.is-decision-submitted-to-bank { color: #245b91; background: #e7f1ff; }
.agent-application-badge.is-decision-bank-approved { color: var(--agent-success); background: color-mix(in srgb, var(--agent-success) 10%, var(--agent-white)); }
/* Category colors are fixed across partner brands; text always names the category. */
.agent-application-row.is-type-prequal,
.agent-application-type.is-type-prequal { --application-type-accent: #1d4ed8; --application-type-tint: #eff6ff; }
.agent-application-row.is-type-traditional,
.agent-application-type.is-type-traditional { --application-type-accent: #0f766e; --application-type-tint: #f0fdfa; }
.agent-application-row.is-type-crypto,
.agent-application-type.is-type-crypto { --application-type-accent: #6d28d9; --application-type-tint: #f5f3ff; }
.agent-application-row:is(.is-type-prequal, .is-type-traditional, .is-type-crypto) {
  border-inline-start: 4px solid var(--application-type-accent);
}
.agent-application-type:not(.is-type-neutral) { color: var(--application-type-accent); background: var(--application-type-tint); }
.agent-application-badge.is-signature-pending,
.agent-application-badge.is-decision-pending-signature { color: #92400e; background: #fff7ed; }
.agent-application-detail { min-width: 0; }
.agent-application-detail__head { min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; }
.agent-application-detail__head .agent-kicker { margin-bottom: 6px; }
.agent-application-detail__head h3 { margin: 0 0 8px; }
.agent-application-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.agent-application-empty { min-height: 250px; display: grid; place-content: center; justify-items: start; }
.agent-application-empty h3 { margin: 12px 0 6px; }
.agent-application-empty p,
.agent-application-empty-copy { max-width: 520px; margin: 0; color: var(--agent-muted); font-size: 13px; line-height: 1.55; }
.agent-application-block { min-width: 0; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--agent-line); }
.agent-application-block h4 { margin: 0 0 14px; color: var(--agent-ink); font-size: 14px; letter-spacing: -.01em; }
.agent-application-decision { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.agent-application-decision label { display: grid; gap: 7px; color: var(--agent-ink); font-size: 12px; font-weight: 800; }
.agent-application-decision select { min-width: 180px; min-height: 42px; padding: 8px 36px 8px 11px; border: 1px solid var(--agent-line); border-radius: 9px; color: var(--agent-ink); background: var(--agent-white); font: inherit; }
.agent-application-attribution { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; color: var(--agent-ink); font-size: 14px; }
.agent-application-attribution small { flex-basis: 100%; color: var(--agent-muted); font-size: 11px; }
.agent-application-fields { min-width: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.agent-application-field { min-width: 0; padding: 12px; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: 10px; }
.agent-application-field dt { margin-bottom: 5px; color: var(--agent-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agent-application-value { min-width: 0; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--agent-ink); font-size: 13px; line-height: 1.45; }
.agent-application-signature { display: block; width: auto; max-width: 100%; max-height: 140px; object-fit: contain; background: var(--agent-white); border-radius: 6px; }
.agent-document-list { min-width: 0; display: grid; gap: 9px; }
.agent-document-row { min-width: 0; padding: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 11px 18px; background: var(--agent-base); border: 1px solid var(--agent-line); border-radius: 10px; }
.agent-document-row > div { min-width: 0; }
.agent-document-row strong,
.agent-document-row small { display: block; min-width: 0; overflow-wrap: anywhere; }
.agent-document-row strong { color: var(--agent-ink); font-size: 13px; }
.agent-document-row small { margin-top: 3px; color: var(--agent-muted); font-size: 10px; }
.agent-document-row a { text-decoration: none; }
.agent-onboarding-agreement { margin-top: 18px; border: 1px solid var(--agent-line); border-radius: 10px; background: var(--agent-base); }
.agent-onboarding-agreement summary { padding: 12px 14px; cursor: pointer; color: var(--agent-ink); font-size: 12px; font-weight: 800; }
.agent-onboarding-agreement pre { max-height: 420px; margin: 0; padding: 14px; overflow: auto; border-top: 1px solid var(--agent-line); color: var(--agent-ink); background: var(--agent-white); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }

.agent-footer {
  min-height: 72px;
  padding: 18px clamp(20px, 4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  color: var(--agent-muted);
  background: var(--agent-brand-deep);
  font-size: 12px;
}
.agent-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--agent-white); font-weight: 700; }

/* ---- Feedback where the reader acted (agent-portal.js notify()) ----
   A polite live region always on the page, fixed at the bottom of the screen and empty
   (so nothing shows) until a message arrives. Taps pass through it. */
.agent-toast-region {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  width: min(calc(100% - 32px), 480px);
  transform: translateX(-50%);
  pointer-events: none;
}
.agent-toast {
  margin: 0;
  padding: 13px 16px;
  color: #fff;
  background: var(--agent-brand-deep);
  border-radius: var(--cp-r-sm);
  box-shadow: 0 18px 40px -16px rgba(10, 20, 36, .55);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: agent-toast-in .2s var(--cp-ease) backwards;
}
/* White text on both stays above 7:1. */
.agent-toast.is-success { background: #17643a; }
.agent-toast.is-error { background: #9f1d20; }
@keyframes agent-toast-in { from { opacity: 0; transform: translateY(10px); } }
/* The control itself says it worked ("Copied") for a moment. */
.agent-btn.is-confirmed { color: #17643a; border-color: color-mix(in srgb, #17643a 40%, var(--agent-line)); }

/* A Manage agents row says what its last action did, under its buttons. */
.agent-team-row__status { grid-column: 1 / -1; margin: 0; color: var(--agent-muted); font-size: 12px; line-height: 1.45; }
.agent-team-row__status:empty { display: none; }
.agent-team-row__status.is-error { color: var(--agent-danger); }
.agent-team-row__status.is-success { color: var(--agent-success); }
/* What was typed in the row and not saved yet (agent-portal.js keeps it until Save). */
.agent-team-row__unsaved { align-self: center; padding: 4px 9px; color: #7b5a00; background: #fff7d6; border-radius: var(--cp-r-pill); font-size: 11px; font-weight: 800; }

/* Link builder's links for somebody else: whose they are, above the cards and in sight
   while the grid scrolls (sticky inside the links section), with Restore my links. */
.agent-links-for {
  position: sticky;
  top: 88px;
  z-index: 5;
  margin-top: 16px;
  padding: 12px 14px 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  color: #fff;
  background: var(--agent-brand-deep);
  border-radius: var(--cp-r-sm);
  box-shadow: var(--cp-sh-navy);
  scroll-margin-top: 88px;
}
.agent-links-for:focus-visible { outline: 3px solid color-mix(in srgb, var(--agent-brand) 45%, transparent); outline-offset: 3px; }
.agent-links-for p { min-width: 0; margin: 0; overflow-wrap: anywhere; line-height: 1.35; }
.agent-links-for span { display: block; color: var(--cp-on-dark-mut); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.agent-links-for strong { font-size: 17px; }
.agent-links-for .agent-btn { color: var(--agent-brand-deep); background: #fff; border-color: transparent; }

/* A section shown from inside another (the Sales Documents card) is scrolled to its top,
   clear of the sticky header. */
.agent-section { scroll-margin-top: 92px; }

@media (max-width: 980px) {
  .agent-auth { grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); gap: 44px; }
  .agent-link-card,
  .agent-link-card--featured,
  .agent-link-card--tool { grid-column: span 6; }
  .agent-admin-layout,
  .agent-admin-layout--team,
  .agent-application-layout { grid-template-columns: minmax(0, 1fr); }
  /* Stacked, the page scrolls to the open application and back to its row
     (agent-portal.js), clear of the sticky header. */
  .agent-btn.agent-application-back { display: inline-flex; }
  .agent-application-detail,
  .agent-application-row,
  .agent-application-panel { scroll-margin-top: 92px; }
}

@media (max-width: 720px) {
  .agent-header { position: relative; padding: 12px 20px; }
  .agent-security { display: none; }
  .agent-brand img { width: 154px; height: auto; }
  .agent-profile > span { max-width: 150px; }
  .agent-auth { width: min(100% - 32px, 560px); grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 42px 0 58px; }
  .agent-auth__card { order: -1; }
  .agent-auth__message h1 { font-size: clamp(40px, 13vw, 62px); }
  .agent-auth__message > p { font-size: 17px; }
  .agent-workspace { width: min(100% - 32px, 620px); padding-top: 38px; }
  .agent-welcome { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .agent-welcome h1 { font-size: clamp(39px, 12vw, 58px); }
  .agent-tabs { overflow: visible; }
  .agent-tabs button { flex: 1 1 140px; }
  .agent-link-card,
  .agent-link-card--featured,
  .agent-link-card--tool { grid-column: 1 / -1; min-height: 286px; }
  .agent-form-grid { grid-template-columns: minmax(0, 1fr); }
  .agent-team-row { grid-template-columns: minmax(0, 1fr); }
  .agent-org-agent-row { flex-direction: column; align-items: stretch; }
  .agent-org-agent-row__actions .agent-btn { flex: 1 1 120px; }
  .agent-team-row__access .agent-app-access__grid label:last-child { grid-column: 1 / -1; }
  .agent-application-fields { grid-template-columns: minmax(0, 1fr); }
  .agent-application-search__control { align-items: stretch; }
  /* The header scrolls away here. */
  .agent-application-detail,
  .agent-application-row,
  .agent-application-panel { scroll-margin-top: 16px; }
  .agent-team-row__identity strong,
  .agent-team-row__identity small { white-space: normal; overflow-wrap: anywhere; }
  .agent-team-row__actions .agent-btn { flex: 1 1 120px; }
  .agent-footer { align-items: flex-start; }
}

/* The header scrolls away on a phone, so nothing sits below it. */
@media (max-width: 720px) {
  .agent-links-for { top: 8px; scroll-margin-top: 8px; }
  .agent-section { scroll-margin-top: 16px; }
}

@media (max-width: 420px) {
  .agent-header { align-items: flex-start; }
  .agent-header__right { width: 100%; justify-content: flex-end; }
  .agent-profile { width: 100%; justify-content: space-between; }
  .agent-auth__card,
  .agent-panel { padding: 24px 20px; }
  .agent-link-card { padding: 22px 20px; }
  .agent-card-actions .agent-btn { flex: 1 1 100%; }
  .agent-btn--icon { min-width: 100%; }
  .agent-application-search__control { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Card on file held in Chance's own vault (application detail). */
.agent-card-vault__summary { margin: 0 0 8px; color: var(--agent-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agent-card-vault__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.agent-card-vault__reveal { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--agent-line); border-radius: 12px; background: #f7fafd; }
.agent-card-vault__reveal[hidden] { display: none; }
.agent-card-vault__number { font-size: 17px; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.agent-card-vault__countdown { color: var(--agent-muted); }

/* ---- Phone widths: no zoom on focus (QA #6) ----
   iPhone Safari zooms into a focused field whose text is under 16px and stays zoomed.
   Below 768px (the breakpoint the public forms use for the same fix) every typing field
   in the agent area is 16px: forms and the partner editor (15px above it), the
   application search and Manage agents rows (13px), the partner filter (12px). Last in
   the sheet, so it outweighs them; wider screens keep their sizes. */
@media (max-width: 767px) {
  body.agent-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
  body.agent-body select,
  body.agent-body textarea { font-size: 16px; }
}

/* Deck invitation controls retain native disclosure and keyboard behavior. */
#deck-access-panel > summary { min-height:44px; line-height:44px; cursor:pointer; font-weight:700; }
#deck-access-panel { margin-bottom:28px; }
#deck-access-panel #deck-access-result { margin-top:20px; }
