.sidebar-link[data-sidebar-action="ai-agent"]::before {
  content: "AI";
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, #0e7b58, #064b38);
  color: #fff;
  font-size: .58rem;
  font-weight: 950;
  letter-spacing: -.04em;
}

.sidebar-link[data-sidebar-action="ai-agent"] {
  margin: 7px 0;
  border: 1px solid rgba(35, 127, 98, .18);
  background: linear-gradient(90deg, rgba(35, 127, 98, .1), rgba(35, 127, 98, .03));
}

#ai-agent-panel.ai-agent-host {
  --ai-agent-chat-height: clamp(760px, calc(100vh - 150px), 1040px);
  width: min(100%, 1460px);
  min-height: calc(100vh - 112px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(12, 94, 68, .14);
  border-radius: 18px;
  background: #f5f8f6;
  box-shadow: 0 22px 60px rgba(19, 55, 44, .11);
}

.ai-agent-host-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 25px;
  border-bottom: 1px solid #dfe8e4;
  background: rgba(255, 255, 255, .94);
}

.ai-agent-host-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.ai-agent-host-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(145deg, #15916a, #064c39);
  color: #fff;
  box-shadow: 0 10px 24px rgba(8, 107, 79, .22);
  font-size: .88rem;
  font-weight: 950;
}

.ai-agent-host-head h2,
.ai-agent-host-head p {
  margin: 0;
}

.ai-agent-host-head h2 {
  font-size: 1.18rem;
  letter-spacing: -.02em;
}

.ai-agent-host-head p {
  margin-top: 4px;
  color: #68766f;
  font-size: .78rem;
}

.ai-agent-connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #52645d;
  font-size: .75rem;
  font-weight: 800;
}

.ai-agent-connection::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d5a82c;
  box-shadow: 0 0 0 4px rgba(213, 168, 44, .13);
}

.ai-agent-connection.is-ready::before {
  background: #1b9a6c;
  box-shadow: 0 0 0 4px rgba(27, 154, 108, .13);
}

.ai-agent-connection.is-error::before {
  background: #c64736;
  box-shadow: 0 0 0 4px rgba(198, 71, 54, .12);
}

.ai-agent-frame-wrap {
  position: relative;
  min-height: calc(var(--ai-agent-chat-height) + 32px);
  padding: 16px;
}

.ai-agent-frame {
  width: 100%;
  height: var(--ai-agent-chat-height);
  min-height: var(--ai-agent-chat-height);
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 36px rgba(20, 51, 41, .09);
}

.ai-agent-preview {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 880px);
  height: var(--ai-agent-chat-height);
  min-height: var(--ai-agent-chat-height);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #dce7e2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(20, 55, 43, .1);
}

.ai-agent-preview[hidden] {
  display: none;
}

.ai-agent-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e4ebe8;
}

.ai-agent-preview-header strong,
.ai-agent-preview-header span {
  display: block;
}

.ai-agent-preview-header span {
  margin-top: 4px;
  color: #75827d;
  font-size: .72rem;
}

.ai-agent-secure-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf8f3;
  color: #0d7252;
  font-size: .68rem;
  font-weight: 900;
}

.ai-agent-preview-body {
  display: grid;
  place-items: center;
  padding: 38px 24px;
  background:
    radial-gradient(circle at 50% 15%, rgba(35, 127, 98, .09), transparent 42%),
    #fbfdfc;
  text-align: center;
}

.ai-agent-preview-body > div {
  width: min(100%, 600px);
}

.ai-agent-preview-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecf7f2;
  color: #0a7453;
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ai-agent-preview-body h3 {
  margin: 18px 0 10px;
  color: #17241f;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.ai-agent-preview-body p {
  margin: 0 auto;
  color: #65736e;
  font-size: .9rem;
  line-height: 1.6;
}

.ai-agent-suggestions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.ai-agent-suggestions span {
  padding: 9px 12px;
  border: 1px solid #dce8e3;
  border-radius: 10px;
  background: #fff;
  color: #345047;
  font-size: .73rem;
  font-weight: 750;
}

.ai-agent-preview-composer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px;
  padding: 10px 10px 10px 16px;
  border: 1px solid #dbe5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(27, 62, 50, .07);
}

.ai-agent-preview-composer span {
  flex: 1;
  color: #909b97;
  font-size: .82rem;
}

.ai-agent-preview-composer button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #0b7656;
  color: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  opacity: .55;
}

@media (max-width: 720px) {
  #ai-agent-panel.ai-agent-host {
    --ai-agent-chat-height: clamp(580px, calc(100dvh - 120px), 820px);
    min-height: calc(100vh - 88px);
    border-radius: 12px;
  }
  .ai-agent-host-head { align-items: flex-start; flex-direction: column; padding: 17px; }
  .ai-agent-frame-wrap { min-height: calc(var(--ai-agent-chat-height) + 20px); padding: 10px; }
  .ai-agent-preview, .ai-agent-frame {
    height: var(--ai-agent-chat-height);
    min-height: var(--ai-agent-chat-height);
  }
  .ai-agent-suggestions { display: none; }
}
