/* Visual chat cards share the University's theme tokens. No global layout rules. */
.uni-chat-cards {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 16px 0;
  padding: 22px;
  border: 1px solid
    color-mix(in srgb, var(--uni-border, #e2e7e3) 65%, transparent);
  border-radius: 20px;
  background: var(--uni-surface, #fff);
  color: var(--ink, #243b2e);
  box-shadow: 0 5px 22px #183b2605;
  animation: uni-chat-card-in 220ms ease-out both;
  overflow-wrap: anywhere;
}
.uni-chat-cards *,
.uni-chat-cards *::before,
.uni-chat-cards *::after {
  box-sizing: border-box;
}
.uni-chat-cards h3,
.uni-chat-cards h4,
.uni-chat-cards p {
  margin: 0;
}
.uni-chat-cards h3 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.uni-chat-cards h4 {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}
.uni-chat-cards p {
  color: var(--mut, #68786d);
  font-size: 13px;
  line-height: 1.65;
}
.uni-chat-cards svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}
.uni-chat-cards-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.uni-chat-cards-heading > div {
  min-width: 0;
}
.uni-chat-cards-symbol {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--uni-accent, #24533d) 9%, transparent);
  color: var(--uni-accent, #24533d);
}
.uni-chat-cards-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--mut, #68786d);
  font-size: 9px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.cx-pub .uni-chat-cards :is(a, button) {
  font-family: inherit;
}
.cx-pub .uni-chat-cards :is(a, button):focus-visible {
  outline: 2px solid var(--uni-focus, #658b7a);
  outline-offset: 3px;
}

.uni-chat-cards--video {
  display: grid;
  grid-template-columns: minmax(84px, 32%) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  align-items: center;
}
.cx-pub .uni-chat-cards-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--uni-soft, #f4f7f4);
  color: #214c31;
  cursor: pointer;
}
.uni-chat-cards-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uni-chat-cards-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(transparent 45%, #102a181a);
}
.uni-chat-cards-play svg {
  width: 42px;
  height: 42px;
  padding: 11px;
  border-radius: 50%;
  background: #fafff3f2;
  color: #244f37;
  box-shadow: 0 3px 15px #142d3226;
  transition: transform 180ms ease;
}
.uni-chat-cards-cover:hover .uni-chat-cards-play svg {
  transform: scale(1.07);
}
.uni-chat-cards-duration,
.uni-chat-cards-format {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  background: #17241bd9;
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.uni-chat-cards-format {
  left: 8px;
  right: auto;
}
.uni-chat-cards-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--uni-accent, #24533d);
  background: radial-gradient(
    ellipse at 70% 20%,
    color-mix(in srgb, var(--uni-accent, #24533d) 12%, transparent),
    transparent 80%
  );
}
.uni-chat-cards-placeholder svg {
  width: 38px;
  height: 38px;
  opacity: 0.65;
}
.uni-chat-cards-video-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px 6px 0;
}
.uni-chat-cards-video-copy .uni-chat-cards-kicker {
  margin: 0;
}
.uni-chat-cards-video-copy h3 {
  font-size: 14px;
}
.uni-chat-cards-video-copy p {
  font-size: 12px;
}
.uni-chat-cards-video-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 14px;
}
.cx-pub .uni-chat-cards-watch,
.cx-pub .uni-chat-cards-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--uni-accent, #24533d);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.uni-chat-cards-watch svg,
.uni-chat-cards-text-link svg {
  width: 16px;
  height: 16px;
}
.cx-pub .uni-chat-cards-text-link {
  color: var(--mut, #68786d);
  font-weight: 500;
}

.uni-chat-cards-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.uni-chat-cards-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 22px;
}
.uni-chat-cards-steps li:last-child {
  padding-bottom: 0;
}
.uni-chat-cards-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 35px;
  bottom: 7px;
  width: 1px;
  background: color-mix(in srgb, var(--uni-accent, #24533d) 18%, transparent);
}
.uni-chat-cards-step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--uni-accent, #24533d);
  background: color-mix(in srgb, var(--uni-accent, #24533d) 8%, transparent);
  font-size: 12px;
  font-weight: 650;
}
.uni-chat-cards-steps p {
  margin-top: 5px;
  font-size: 12px;
}

.uni-chat-cards.uni-prompt-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--uni-surface, #fff);
}
.uni-chat-cards.uni-prompt-card h3 {
  margin: 0;
}
.uni-chat-cards.uni-prompt-card pre[hidden] {
  display: none;
}
.uni-chat-cards.uni-prompt-card pre {
  padding: 15px 16px;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--uni-soft, #f4f7f4);
  color: var(--ink, #243b2e);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.uni-chat-cards.uni-prompt-card pre:focus-visible {
  outline: 2px solid var(--uni-focus, #658b7a);
  outline-offset: 2px;
}
.uni-chat-cards-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 13px;
}
.cx-pub .uni-chat-cards .uni-chat-cards-primary,
.cx-pub .uni-chat-cards .uni-chat-cards-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: var(--uni-accent, #24533d);
  color: var(--uni-accent-text, #fff);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.cx-pub .uni-chat-cards .uni-chat-cards-secondary {
  border-color: color-mix(in srgb, var(--uni-border, #e2e7e3) 65%, transparent);
  background: transparent;
  color: var(--ink, #243b2e);
}
.uni-chat-cards-primary svg,
.uni-chat-cards-secondary svg {
  width: 16px;
  height: 16px;
}
.uni-chat-cards.uni-prompt-card .uni-chat-cards-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}
.uni-chat-cards .uni-prompt-status {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
}
.uni-chat-cards .uni-prompt-status:empty {
  display: none;
}
.uni-chat-cards--checkout > p {
  margin: -4px 0 18px;
}

.uni-chat-cards-skeleton {
  box-shadow: none;
}
.uni-chat-cards-skeleton > div {
  display: grid;
  gap: 16px;
}
.uni-chat-cards-skeleton span:not(.uni-chat-cards-sr) {
  display: grid;
  gap: 12px;
  align-content: center;
  min-width: 0;
}
.uni-chat-cards-skeleton i {
  display: block;
  height: 12px;
  width: 100%;
  border-radius: 5px;
  background: linear-gradient(
    110deg,
    var(--uni-soft, #f4f7f4) 25%,
    var(--uni-border, #e2e7e3) 45%,
    var(--uni-soft, #f4f7f4) 65%
  );
  background-size: 220% 100%;
  animation: uni-chat-card-skeleton 1.8s linear infinite;
}
.uni-chat-cards-skeleton i:last-child {
  width: 66%;
}
.uni-chat-cards-skeleton i:first-child {
  height: 17px;
  width: 82%;
}
.uni-chat-cards-skeleton--video > div {
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
}
.uni-chat-cards-skeleton .uni-chat-cards-skeleton-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
}
.uni-chat-cards-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes uni-chat-card-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes uni-chat-card-skeleton {
  from {
    background-position: 160% 0;
  }
  to {
    background-position: -60% 0;
  }
}
@media (max-width: 520px) {
  /* Extra room for the wrapped explanation, independent of prompt length.
     A stable height avoids resizing the card when the software keyboard opens. */
  .uni-chat-cards.uni-prompt-card {
    height: 480px;
  }
  .uni-chat-cards,
  .uni-chat-cards.uni-prompt-card {
    padding: 17px;
    border-radius: 17px;
  }
  .uni-chat-cards--video {
    grid-template-columns: minmax(84px, 30%) minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  .uni-chat-cards-video-copy {
    padding: 2px 5px 4px;
  }
  .uni-chat-cards h3 {
    font-size: 15px;
  }
  .uni-chat-cards-heading {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 17px;
  }
  .uni-chat-cards-symbol {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .uni-chat-cards-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .cx-pub
    .uni-chat-cards-actions
    :is(.uni-chat-cards-primary, .uni-chat-cards-secondary) {
    width: 100%;
  }
  .uni-chat-cards-steps li {
    gap: 10px;
  }
  .uni-chat-cards-skeleton--video > div {
    grid-template-columns: minmax(84px, 30%) minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .uni-chat-cards,
  .uni-chat-cards-skeleton i {
    animation: none;
  }
  .uni-chat-cards-play svg {
    transition: none;
  }
  .uni-chat-cards-cover:hover .uni-chat-cards-play svg {
    transform: none;
  }
}
html[data-uni-motion="reduced"]
  :is(.uni-chat-cards, .uni-chat-cards-skeleton i) {
  animation: none;
}
html[data-uni-motion="reduced"] .uni-chat-cards-play svg {
  transition: none;
}
html[data-uni-motion="reduced"]
  .uni-chat-cards-cover:hover
  .uni-chat-cards-play
  svg {
  transform: none;
}

/* Compact lesson pills. Extra sources use native, keyboard-accessible disclosure. */
.uni-chat-cards-videos,
.uni-chat-videos-extra {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.uni-chat-cards-videos .uni-chat-cards--video {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 18px;
  box-shadow: none;
}
.uni-chat-cards-videos .uni-chat-cards-cover {
  height: 44px;
  border-radius: 12px;
}
.uni-chat-cards-videos .uni-chat-cards-video-copy {
  display: block;
  min-width: 0;
  padding: 0;
}
.uni-chat-cards-videos .uni-chat-cards-video-copy h3 {
  font-size: 13px;
  line-height: 1.35;
}
.cx-pub .uni-chat-cards-videos .uni-chat-cards-watch {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 5px 0;
  font-size: inherit;
  line-height: inherit;
  color: var(--ink, #243b2e);
}
.uni-chat-cards-videos .uni-chat-cards-watch > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.cx-pub .uni-chat-cards-videos .uni-chat-cards-text-link {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}
.cx-pub .uni-chat-cards-videos .uni-chat-cards-text-link:hover {
  background: var(--uni-soft, #f4f7f4);
}
.uni-chat-cards-videos .uni-chat-cards-play svg {
  width: 24px;
  height: 24px;
  padding: 6px;
}
.uni-chat-cards-videos .uni-chat-cards-duration {
  right: 2px;
  bottom: 2px;
  padding: 1px 3px;
  font-size: 8px;
}
.uni-chat-cards-videos .uni-chat-cards-format { display: none; }
.uni-chat-videos-more { min-width: 0; }
.uni-chat-videos-more > summary {
  width: fit-content;
  min-height: 44px;
  margin: 0 auto;
  padding: 12px 16px;
  color: var(--uni-accent, #24533d);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.uni-chat-videos-more > summary::-webkit-details-marker { display: none; }
.uni-chat-videos-more > summary:focus-visible {
  outline: 2px solid var(--uni-focus, #658b7a);
  outline-offset: 2px;
  border-radius: 8px;
}
.uni-chat-videos-more .uni-chat-show-less,
.uni-chat-videos-more[open] .uni-chat-show-more { display: none; }
.uni-chat-videos-more[open] .uni-chat-show-less { display: inline; }
.uni-chat-cards-videos .uni-chat-cards-skeleton .uni-chat-cards-skeleton-cover {
  height: 44px;
  width: 72px;
  border-radius: 12px;
}
.uni-chat-cards-skeleton--group-video .uni-chat-cards-video-copy i { height: 10px; margin: 6px 0; }
.uni-chat-cards-skeleton--group-video .uni-chat-cards-video-copy i:nth-child(n+3) { display: none; }
.uni-chat-cards-skeleton--prompt { width: min(100%, 380px); padding: 0; }
.uni-chat-cards-skeleton--prompt i:first-child { width: 100%; height: 52px; border-radius: 99px; }

/* Only the contextual handoff button is visible; literal text is a copy fallback. */
.uni-chat-cards.uni-prompt-card.uni-chat-cards--prompt {
  display: grid;
  gap: 10px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.uni-chat-cards--prompt .uni-chat-cards-actions {
  margin-bottom: 0;
}
.uni-chat-cards .uni-chat-run-intro {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.75;
}
.cx-pub .uni-chat-cards .uni-chat-cards-run {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 56px;
  padding: 16px 26px;
  border: 0;
  background: #b9ff62;
  color: #143c26;
  font-size: 15px;
  font-weight: 750;
  text-align: center;
  box-shadow:
    0 0 0 1px #99df51,
    0 6px 26px #86df4b35;
  animation: uni-max-glow 3s ease-in-out infinite;
}
.uni-chat-cards-run::before {
  content: "";
  position: absolute;
  z-index: -2;
  width: 110%;
  aspect-ratio: 1;
  left: -5%;
  top: 50%;
  background: conic-gradient(
    from 0deg,
    #7de51d,
    #c6ff91 38%,
    #f4ffe3 47%,
    #fff 50%,
    #36b90a 56%,
    #7de51d 75%
  );
  animation: uni-max-orbit 4s linear infinite;
}
.uni-chat-cards-run::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(110deg, #caff85, #a6ef55);
}
.uni-chat-cards-run > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
.cx-pub .uni-chat-cards .uni-chat-cards-run:hover::after {
  background: #caff85;
}
.cx-pub .uni-chat-cards .uni-chat-cards-run:focus-visible {
  outline: 3px solid #24533d;
  outline-offset: 5px;
}
.uni-chat-cards-actions--secondary {
  margin-top: 18px;
}
.uni-chat-cards-details {
  margin-top: 20px;
  border-top: 1px solid var(--uni-border, #e2e7e3);
}
.uni-chat-cards-details > summary {
  padding: 16px 0 4px;
  color: var(--uni-accent, #24533d);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.uni-chat-cards-details[open] > summary {
  padding-bottom: 18px;
}
.uni-chat-cards-details > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.uni-chat-videos-intro {
  grid-column: 1 / -1;
  margin: 10px 0 0;
}
.uni-chat-videos-intro h3 {
  margin: 7px 0;
  color: var(--ink, #202622);
  font-size: 16px;
}
.uni-chat-videos-intro p {
  margin: 0 0 4px;
  color: var(--mut, #657168);
  font-size: 13px;
  line-height: 1.7;
}
@keyframes uni-max-orbit {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}
@keyframes uni-max-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px #99df51,
      0 6px 22px #86df4b35;
  }
  50% {
    box-shadow:
      0 0 0 1px #99df51,
      0 6px 28px #86df4b75;
  }
}
@media (max-width: 520px) {
  .cx-pub .uni-chat-cards .uni-chat-cards-run {
    padding: 15px 18px;
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cx-pub .uni-chat-cards .uni-chat-cards-run,
  .uni-chat-cards-run::before {
    animation: none;
  }
}
html[data-uni-motion="reduced"] .uni-chat-cards .uni-chat-cards-run,
html[data-uni-motion="reduced"] .uni-chat-cards-run::before {
  animation: none;
}

/* One concise explanation before the final handoff; no secondary actions. */
.uni-chat-cards--prompt .uni-chat-prompt-description {
  margin: 10px 0 18px;
  width: 100%;
  max-width: none;
  color: var(--uni-muted, #637168);
  font-size: 14px;
  line-height: 1.6;
  text-wrap: pretty;
}
@media (max-width: 600px) {
  .uni-chat-cards--prompt .uni-chat-prompt-description {
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.55;
  }
}

.uni-chat-cards-run > .uni-chat-run-label {
  flex-direction: row;
  gap: 3px;
}
.uni-chat-run-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.uni-chat-run-note {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

/* Clipboard feedback remains below the primary action. */
.uni-chat-cards.uni-prompt-card > .uni-chat-cards-heading,
.uni-chat-cards.uni-prompt-card > .uni-chat-prompt-description,
.uni-chat-cards.uni-prompt-card > .uni-chat-cards-actions,
.uni-chat-cards.uni-prompt-card > .uni-prompt-status {
  margin: 0;
}
.uni-chat-cards.uni-prompt-card > .uni-prompt-status:empty {
  display: none;
}

.uni-chat-cards--prompt .uni-chat-cards-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.uni-chat-run-title { white-space: normal; }
.uni-chat-run-note { color: var(--uni-muted, #637168); text-align: center; }

@media (max-width: 600px) {
  .cx-pub .uni-chat-cards--prompt .uni-chat-cards-run { width: 100%; font-size: 14px; padding: 14px 16px; }
  .uni-chat-cards-videos .uni-chat-cards--video { grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 8px; }
  .uni-chat-cards-videos .uni-chat-cards-video-copy h3 { font-size: 12px; }
}
