.ai-companion {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 0.95fr) minmax(0, 1.05fr);
  gap: 0;
  min-height: 310px;
  margin: 0 0 38px;
  overflow: hidden;
  border: 1px solid #e4e3de;
  border-radius: 20px;
  background: #f5f3ed;
}
.ai-character-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 22px 25px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .78), transparent 39%),
    linear-gradient(145deg, #eeece5 0%, #e5e2d8 100%);
}
.ai-character-stage::after {
  position: absolute;
  right: -34px;
  bottom: -72px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(36, 36, 34, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(36, 36, 34, .025), 0 0 0 44px rgba(36, 36, 34, .018);
  content: "";
  pointer-events: none;
}
.ai-stage-topline,
.ai-character-caption {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ai-stage-topline .eyebrow { margin: 0; }
.ai-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8e8c84;
  font-size: 12px;
}
.ai-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a9a7d;
  box-shadow: 0 0 0 4px rgba(138, 154, 125, .14);
}
.ai-character-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 218px;
  place-items: center;
}
.ai-character {
  width: clamp(156px, 54%, 198px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}
.ai-character svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ai-character-caption {
  color: #8d8b83;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .02em;
}
.ai-character-caption span:last-child {
  color: #a2a097;
  font-family: inherit;
  font-size: 12px;
}
.ai-companion-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 40px;
  background: rgba(255, 255, 255, .48);
}
.ai-companion-copy .eyebrow { margin: 0 0 17px; }
.ai-companion-copy h2 {
  margin: 0;
  color: #242422;
  font-size: clamp(27px, 3.1vw, 40px);
  font-weight: 620;
  letter-spacing: -1.8px;
  line-height: 1.16;
}
.ai-companion-copy p.muted {
  max-width: 360px;
  margin: 20px 0 0;
  color: #77766f;
  font-size: 14px;
}
.ai-companion-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 25px;
  color: #94928a;
  font-size: 12px;
}
.ai-note-mark {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid #d3d0c7;
  border-radius: 50%;
  color: #848177;
  font-size: 11px;
}
.ai-playground-link {
  align-self: flex-start;
  margin-top: 18px;
  color: #77766f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px solid #cfccc3;
  transition: color .2s ease, border-color .2s ease;
}
.ai-playground-link:hover {
  color: #242422;
  border-color: #242422;
}
.ai-debug {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 4;
  padding: 13px 14px 14px;
  border: 1px solid #393832;
  border-radius: 13px;
  background: rgba(35, 34, 30, .96);
  color: #f5f3ed;
  box-shadow: 0 12px 30px rgba(36, 36, 34, .16);
}
.ai-debug[hidden] { display: none; }
.ai-debug-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #e5e2d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.ai-debug-head span:last-child { color: #aaa79a; }
.ai-debug-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
}
.ai-debug label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #aaa79a;
  font-size: 10px;
}
.ai-debug select,
.ai-debug input,
.ai-debug button {
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid #504e47;
  border-radius: 7px;
  color: #f5f3ed;
  background: #2c2b26;
  font-size: 11px;
}
.ai-debug input { padding: 0; accent-color: #d9cfac; }
.ai-debug button { cursor: pointer; }
.ai-debug button:hover { border-color: #d9cfac; background: #393832; }

@media (max-width: 650px) {
  .ai-companion { grid-template-columns: 1fr; }
  .ai-character-stage { min-height: 286px; }
  .ai-character-wrap { min-height: 188px; }
  .ai-companion-copy { padding: 29px 25px 31px; }
  .ai-companion-copy h2 { font-size: 31px; }
  .ai-debug-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
