/* greentv.media kit coach — greentv.com Olivia look (open by default) */
/* Reserve right rail so page copy does not sit under the panel */
body.gtv-has-kit-coach {
  padding-right: min(340px, 36vw);
}
body.gtv-has-kit-coach .wrap {
  /* keep content left of the coach */
  max-width: min(1480px, calc(100% - 8px));
}

#kit-coach {
  position: fixed;
  right: 12px;
  top: 12px;
  bottom: auto; /* size to content — no full-height stretch / gap under Ask */
  z-index: 99990;
  width: min(308px, calc(36vw - 16px));
  max-width: 320px;
  max-height: calc(100vh - 24px);
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  color: #f8f5f0;
  filter: drop-shadow(0 14px 36px rgba(0, 0, 0, 0.45));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  overflow: hidden;
}
#kit-coach .gtv-com-assistant__panel {
  pointer-events: auto;
  flex: 0 1 auto; /* hug content; no empty stretch under chat */
  min-height: 0;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#kit-coach .kit-engage {
  pointer-events: auto;
  flex: 0 0 auto;
  margin-top: 0;
}
.gtv-com-assistant__panel {
  border-radius: 18px;
  border: 1px solid rgba(197, 164, 110, 0.28);
  background:
    radial-gradient(circle at top, rgba(74, 222, 128, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(15, 42, 31, 0.98), rgba(2, 12, 9, 0.99));
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.gtv-com-assistant__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 8px 0;
  flex-wrap: nowrap;
}
.gtv-com-assistant__pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #eff8f0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.gtv-com-assistant__actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.gtv-com-assistant__actions button {
  border: 1px solid rgba(0, 177, 64, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: #e8fff0;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 0.7rem;
  cursor: pointer;
}
.gtv-com-assistant__actions button:hover { border-color: #00ff6b; }

.gtv-com-assistant__card {
  margin: 8px 8px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at top, rgba(74, 222, 128, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(31, 58, 47, 0.95), rgba(7, 22, 15, 0.98));
  overflow: hidden;
  flex-shrink: 0;
}
.gtv-com-assistant__visual {
  position: relative;
  width: 100%;
  /* Olivia mp4 is 426×240 with ~108px baked pillarbox each side (face ~216×240).
     Portrait frame matches face AR so cover can fill sides without eating the top. */
  aspect-ratio: 216 / 240; /* ~0.9 — content box of source */
  height: auto;
  overflow: hidden;
  background: #06140e;
}
/*
 * Fill frame edge-to-edge. object-position top keeps forehead/hair;
 * cover + portrait AR crops only the baked black side bars.
 */
.gtv-com-assistant__visual video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top; /* never crop the top */
  pointer-events: none;
  background: transparent;
  border: 0;
}
.gtv-com-assistant__visual.is-talking {
  box-shadow: inset 0 0 0 2px rgba(0, 255, 107, 0.45);
}
.gtv-com-assistant__visual.is-talking video {
  filter: brightness(1.05) saturate(1.05);
}
.gtv-com-assistant__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.4));
  pointer-events: none;
}
.gtv-com-assistant__caption {
  padding: 8px 10px 10px;
  display: grid;
  gap: 2px;
}
.gtv-com-assistant__caption strong {
  display: block;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.25;
}
.gtv-com-assistant__caption span {
  color: #d4e1d8;
  font-size: 0.76rem;
  line-height: 1.35;
}

.gtv-com-assistant__body {
  padding: 8px 8px 10px;
  overflow-y: auto;
  min-height: 0;
  flex: 0 1 auto; /* no flex-grow gap under Ask */
}
.gtv-com-assistant__status {
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(248, 245, 240, 0.65);
  margin: 0 0 8px;
  min-height: 1.1em;
}
.gtv-com-assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  max-height: 7.5rem;
  overflow-y: auto;
}
.gtv-com-assistant__chips button {
  border: 1px solid rgba(197, 164, 110, 0.35);
  background: rgba(197, 164, 110, 0.08);
  color: #f0e6d4;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.7rem;
  cursor: pointer;
}
.gtv-com-assistant__chips button:hover {
  border-color: #c5a46e;
  color: #fff;
}
.gtv-com-assistant__chat {
  display: flex;
  gap: 6px;
}
.gtv-com-assistant__chat input {
  flex: 1;
  border-radius: 9px;
  border: 1px solid rgba(0, 177, 64, 0.3);
  background: #0a1611;
  color: #e8fff0;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.8rem;
  min-width: 0;
}
.gtv-com-assistant__chat button {
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  color: #07170f;
  background: #00b140;
}

/* Narrow screens: don't steal half the page; dock lower and shrink avatar */
/* Engagement rail under Olivia — buy in / earn / watch */
.kit-engage {
  border-radius: 14px;
  border: 1px solid rgba(0, 177, 64, 0.28);
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 177, 64, 0.14), transparent 50%),
    linear-gradient(165deg, rgba(10, 24, 18, 0.98), rgba(5, 14, 10, 0.98));
  padding: 10px 10px 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.kit-engage__label {
  margin: 0 0 8px;
  font: 700 10px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c5a46e;
}
.kit-engage__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.kit-engage__card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e8fff0 !important;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.kit-engage__card:hover {
  border-color: rgba(0, 255, 107, 0.45);
  background: rgba(0, 177, 64, 0.12);
  transform: translateY(-1px);
  color: #fff !important;
}
.kit-engage__card--hot {
  border-color: rgba(197, 164, 110, 0.45);
  background: linear-gradient(135deg, rgba(197, 164, 110, 0.16), rgba(0, 177, 64, 0.1));
}
.kit-engage__card--hot:hover {
  border-color: #c5a46e;
}
.kit-engage__card strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.kit-engage__card span {
  font-size: 0.65rem;
  line-height: 1.25;
  color: rgba(232, 255, 240, 0.62);
}
.kit-engage__card:hover span {
  color: rgba(255, 255, 255, 0.78);
}
.kit-engage__foot {
  margin: 8px 2px 0;
  font-size: 0.65rem;
  line-height: 1.3;
  color: rgba(232, 255, 240, 0.5);
}

@media (max-width: 960px) {
  body.gtv-has-kit-coach {
    padding-right: 0;
    padding-bottom: 0;
  }
  #kit-coach {
    top: auto;
    bottom: 10px;
    right: 10px;
    width: min(300px, calc(100vw - 16px));
    max-height: min(78vh, 640px);
  }
  #kit-coach .gtv-com-assistant__panel {
    max-height: calc(min(78vh, 640px) - 150px);
  }
  .kit-engage__card span {
    display: none; /* tighter on small screens */
  }
}

@media (max-width: 560px) {
  #kit-coach {
    width: min(100vw - 16px, 320px);
  }
}
