.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.agent-section {
  position: relative;
  padding-block: var(--section);
  background: var(--paper-soft);
  border-top: 1px solid var(--line);
  overflow: clip;
}

.agent-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.08fr);
  gap: clamp(52px, 8vw, 132px);
  align-items: start;
}

.agent-intro,
.agent-panel-wrap,
.agent-frame,
.agent-view,
.agent-chat,
.agent-messages { min-width: 0; }

.agent-intro .kicker { margin-bottom: 28px; }
.agent-intro h2 {
  max-width: 760px;
  font-size: clamp(56px, 7vw, 106px);
  line-height: .9;
  margin-bottom: 32px;
}
.agent-description {
  max-width: 620px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.5;
  text-wrap: pretty;
}
.agent-access-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 580px;
  margin: 0 0 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 11px/1.55 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.agent-access-note::before {
  content: "";
  width: 8px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(0, 0, 242, .08);
}
.agent-shortcut {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 48px;
  color: var(--ink);
  font: 500 11px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 27px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-bottom-color: rgba(23, 25, 24, .42);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  box-shadow: 0 2px 0 rgba(23, 25, 24, .1);
}

.topic-rails {
  display: grid;
  border-top: 1px solid var(--line);
}
.topic-rail {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color .2s, padding-inline .25s var(--ease), background .2s;
}
.topic-rail:hover,
.topic-rail:focus-visible {
  padding-inline: 12px;
  color: var(--white);
  background: var(--deep);
}
.topic-index {
  color: var(--muted);
  font: 400 10px/1 "IBM Plex Mono", monospace;
}
.topic-rail:hover .topic-index,
.topic-rail:focus-visible .topic-index { color: var(--accent-soft); }
.topic-name { font-size: 16px; font-weight: 530; }
.topic-arrow { font-size: 18px; }

.agent-panel-wrap { position: relative; }
.agent-frame {
  min-height: 720px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(23, 25, 24, .5);
  background: var(--white);
  box-shadow: 14px 14px 0 rgba(10, 10, 56, .07);
  transition: width .35s var(--ease), height .35s var(--ease), transform .35s var(--ease);
}
.agent-frame-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 12px;
  color: var(--white);
  background: var(--deep);
  border-bottom: 1px solid rgba(250, 251, 248, .16);
}
.agent-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  flex: 0 0 auto;
}
.agent-frame-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.agent-frame-title strong {
  font-size: 15px;
  font-weight: 570;
  letter-spacing: -.02em;
}
.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b8bedb;
  font: 400 10px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.agent-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.agent-frame-close {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(250, 251, 248, .25);
  border-radius: 4px;
  background: transparent;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
}

.agent-view {
  flex: 1;
  padding: clamp(24px, 3vw, 42px);
}
.agent-view[hidden] { display: none !important; }
.agent-view-head { margin-bottom: 30px; }
.agent-view-head .agent-step {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font: 500 10px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.agent-view-head h3 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 520;
  line-height: 1;
  letter-spacing: -.045em;
}
.agent-view-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.agent-form { display: grid; gap: 18px; }
.agent-field { display: grid; gap: 8px; }
.agent-field label,
.agent-legend {
  color: var(--ink);
  font: 500 10px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.agent-field input,
.agent-field select,
.agent-code-input,
.agent-composer textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 15px/1.4 "Instrument Sans", sans-serif;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}
.agent-field input:focus,
.agent-field select:focus,
.agent-code-input:focus,
.agent-composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 242, .09);
}
.agent-field small {
  color: var(--muted);
  font: 400 10px/1.4 "IBM Plex Mono", monospace;
}
.agent-consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.agent-consent input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.agent-error {
  min-height: 18px;
  margin: 0;
  color: #a52020;
  font: 500 11px/1.4 "IBM Plex Mono", monospace;
}
.agent-primary,
.agent-secondary {
  min-height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font: 550 14px/1 "Instrument Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.agent-primary:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.agent-secondary { background: transparent; color: var(--ink); }
.agent-secondary:hover { border-color: var(--accent); color: var(--accent); }
.agent-prototype-note {
  margin: 22px 0 0;
  padding: 14px;
  border: 1px solid rgba(0, 0, 242, .2);
  background: rgba(0, 0, 242, .055);
  color: var(--muted);
  font: 400 10px/1.5 "IBM Plex Mono", monospace;
}
.agent-code-input {
  max-width: 280px;
  font: 500 30px/1 "IBM Plex Mono", monospace;
  letter-spacing: .18em;
  text-align: center;
}
.agent-form-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.agent-chat {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.agent-chat-meta {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 400 10px/1.3 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.agent-chat-meta strong { color: var(--ink); font-weight: 500; }
.agent-messages {
  flex: 1;
  min-height: 360px;
  max-height: 470px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  overscroll-behavior: contain;
}
.agent-message {
  max-width: 86%;
  display: grid;
  gap: 7px;
}
.agent-message[data-role="user"] { align-self: flex-end; }
.agent-message-label {
  color: var(--muted);
  font: 500 9px/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.agent-message[data-role="user"] .agent-message-label { text-align: right; }
.agent-message-body {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.52;
  text-wrap: pretty;
}
.agent-message[data-role="user"] .agent-message-body {
  border-color: var(--deep);
  background: var(--deep);
  color: var(--white);
}
.agent-thinking .agent-message-body {
  min-width: 108px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.agent-thinking-text { font-size: 12px; }
.agent-thinking-dots { display: inline-flex; align-items: center; gap: 4px; }
.agent-thinking-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: agentThinkingPulse 1s ease-in-out infinite;
}
.agent-thinking-dot:nth-child(2) { animation-delay: .14s; }
.agent-thinking-dot:nth-child(3) { animation-delay: .28s; }
@keyframes agentThinkingPulse {
  0%, 70%, 100% { opacity: .28; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}
.agent-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 18px;
}
.agent-followup {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 11px/1.2 "Instrument Sans", sans-serif;
  cursor: pointer;
}
.agent-followup:hover { color: var(--accent); border-color: var(--accent); }
.agent-schedule {
  margin: 0 24px 18px;
  padding: 18px;
  color: var(--white);
  background: var(--accent);
}
.agent-schedule[hidden] { display: none; }
.agent-schedule strong { display: block; margin-bottom: 7px; font-size: 17px; }
.agent-schedule p { margin: 0 0 15px; color: #e0e3ff; font-size: 13px; line-height: 1.45; }
.agent-schedule a { color: var(--white); border-bottom: 1px solid currentColor; text-decoration: none; font-size: 13px; font-weight: 550; }
.agent-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.agent-composer textarea { min-height: 50px; max-height: 130px; resize: vertical; }
.agent-send { min-width: 96px; }

.agent-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  border: 0;
  background: rgba(10, 10, 56, .54);
  cursor: default;
}
.agent-overlay-backdrop[hidden] { display: none; }
body.agent-overlay-open { overflow: hidden; }
body.agent-overlay-open .agent-frame {
  position: fixed;
  z-index: 100;
  top: 22px;
  right: 22px;
  bottom: 22px;
  width: min(620px, calc(100vw - 44px));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 28px 80px rgba(10, 10, 56, .3);
}
body.agent-overlay-open .agent-frame-header {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
}
body.agent-overlay-open .agent-frame-close { display: grid; }
body.agent-overlay-open .agent-messages { max-height: none; }

.agent-companion {
  position: fixed;
  z-index: 78;
  top: 0;
  left: 0;
  display: none;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
  transition: opacity .18s;
}
.agent-companion.is-visible { opacity: 1; }
.agent-companion img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(250, 251, 248, .7), 0 4px 14px rgba(10, 10, 56, .18);
}
.agent-companion-label {
  max-width: 240px;
  padding: 8px 10px;
  color: var(--white);
  background: var(--deep);
  font: 500 10px/1.2 "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.agent-mini-chat {
  position: fixed;
  z-index: 90;
  max-height: min(430px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(23, 25, 24, .52);
  background: var(--white);
  box-shadow: 0 22px 60px rgba(10, 10, 56, .28);
}
.agent-mini-chat[hidden] { display: none !important; }
.agent-mini-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  color: var(--white);
  background: var(--deep);
}
.agent-mini-header img { width: 38px; height: 38px; object-fit: cover; }
.agent-mini-header div { min-width: 0; display: grid; gap: 3px; }
.agent-mini-header strong { font-size: 13px; font-weight: 570; }
.agent-mini-header span {
  color: #b8bedb;
  font: 400 9px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.agent-mini-header button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(250, 251, 248, .24);
  background: transparent;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
}
.agent-mini-messages {
  min-height: 170px;
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overscroll-behavior: contain;
}
.agent-mini-messages .agent-message { max-width: 92%; gap: 5px; }
.agent-mini-messages .agent-message-body { padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.agent-mini-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.agent-mini-composer textarea {
  width: 100%;
  min-height: 48px;
  max-height: 96px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 13px/1.35 "Instrument Sans", sans-serif;
  outline: 0;
}
.agent-mini-composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 242, .09); }
.agent-mini-composer button {
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--white);
  font-size: 17px;
  cursor: pointer;
}
.agent-mini-expand {
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font: 500 10px/1 "IBM Plex Mono", monospace;
  cursor: pointer;
}
.agent-mini-expand:hover { color: var(--accent); }

.agent-launcher {
  position: fixed;
  z-index: 79;
  right: 18px;
  bottom: 18px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 0;
  background: var(--deep);
  color: var(--white);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s, transform .25s var(--ease);
  box-shadow: 0 12px 30px rgba(10, 10, 56, .22);
}
.agent-launcher.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.agent-launcher img { width: 40px; height: 40px; object-fit: cover; }
.agent-launcher span { font-size: 13px; font-weight: 550; white-space: nowrap; }
.agent-launcher kbd {
  min-width: 25px;
  min-height: 23px;
  border-color: rgba(250, 251, 248, .28);
  border-bottom-color: rgba(250, 251, 248, .42);
  background: rgba(250, 251, 248, .08);
  color: var(--white);
  box-shadow: none;
  font-size: 9px;
}

.about-brand-logo {
  width: min(100%, 360px);
  aspect-ratio: 356 / 357;
  object-fit: cover;
  display: block;
}

@media (pointer: fine) and (hover: hover) and (min-width: 961px) {
  .agent-companion { display: flex; }
}

@media (max-width: 960px) {
  .agent-layout { grid-template-columns: minmax(0, 1fr); }
  .agent-intro h2 { max-width: 720px; }
  .agent-frame { min-height: 680px; }
  .agent-mini-chat { display: none !important; }
  .agent-launcher { display: flex; }
  .agent-launcher kbd { display: none; }
}

@media (max-width: 640px) {
  .agent-section { padding-block: 90px; }
  .agent-intro h2 { font-size: clamp(52px, 16vw, 76px); }
  .agent-description { font-size: 18px; }
  .agent-shortcut { display: none; }
  .agent-layout { gap: 52px; }
  .agent-frame { min-height: 700px; margin-inline: calc(var(--gutter) * -1); border-inline: 0; box-shadow: none; }
  .agent-view { padding: 24px 18px; }
  .agent-form-actions { display: grid; }
  .agent-primary, .agent-secondary { width: 100%; min-height: 52px; }
  .agent-chat-meta { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 10px; }
  .agent-messages { min-height: 350px; padding: 18px; }
  .agent-message { max-width: 92%; }
  .agent-followups { padding-inline: 18px; }
  .agent-schedule { margin-inline: 18px; }
  .agent-composer { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .agent-send { width: 100%; }
  .agent-launcher { right: 10px; bottom: 10px; min-height: 50px; }
  body.agent-overlay-open .agent-frame {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin-inline: 0;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-companion { display: none !important; }
  .agent-launcher.is-visible { opacity: 1; pointer-events: auto; transform: none; }
  .agent-frame, .agent-launcher { transition: none; }
  .agent-thinking-dot { animation: none; opacity: .75; }
}
