.course-chat {
  padding: 3.5rem 0;
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 52%, #fff7e8 100%);
  border-top: 1px solid rgba(18, 32, 51, 0.12);
  border-bottom: 1px solid rgba(18, 32, 51, 0.12);
}

.chat-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1.4rem;
  align-items: stretch;
  padding: 1.1rem;
  border: 4px solid #0a4a85;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 18px 48px rgba(10, 74, 133, 0.16);
}

.chat-intro,
.chat-box {
  border: 1px solid rgba(18, 32, 51, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 45px rgba(18, 32, 51, 0.11);
}

.chat-intro {
  padding: 1.6rem;
}

.chat-intro h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.08;
  color: #122033;
}

.chat-intro p {
  margin-top: 1rem;
  color: #4b5768;
}

.chat-quick,
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chat-quick {
  margin-top: 1.2rem;
}

.chat-chip {
  border: 1px solid rgba(10, 74, 133, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #0a4a85;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  transition: transform 0.2s, background 0.2s;
}

.chat-chip:hover,
.chat-chip:focus {
  background: #eef6ff;
  transform: translateY(-1px);
  outline: none;
}

.chat-actions {
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(10, 74, 133, 0.12);
}

.chat-actions-title {
  flex: 0 0 100%;
  color: #122033;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  background: #eef6ff;
  color: #0a4a85;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  padding: 0 0.7rem;
}

.chat-action.payment {
  background: #b81818;
  color: #ffffff;
}

.chat-box {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 460px;
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.2rem;
  background: #0a4a85;
  color: #ffffff;
}

.chat-header strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
}

.chat-header span {
  display: block;
  margin-top: 0.1rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 1rem;
  background: #eeeeee;
  scroll-margin-top: 1rem;
}

.chat-placeholder {
  align-self: stretch;
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed rgba(15, 23, 42, 0.25);
  border-radius: 8px;
  color: rgba(15, 23, 42, 0.55);
  font-family: 'Fraunces', serif;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 800;
  text-align: center;
}

.chat-message {
  max-width: 88%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.48;
}

.chat-message.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #122033;
  border: 1px solid rgba(18, 32, 51, 0.12);
}

.chat-message.user {
  align-self: flex-end;
  background: #0a4a85;
  color: #ffffff;
}

.chat-media {
  margin-top: 0.8rem;
  border: 1px solid rgba(10, 74, 133, 0.18);
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.75rem;
}

.chat-media-title {
  display: block;
  color: #122033;
  font-weight: 900;
}

.chat-media-meta {
  margin-top: 0.2rem;
  color: #526173;
  font-size: 0.78rem;
}

.chat-media-description,
.chat-media-fallback {
  margin: 0.55rem 0;
  color: #344154;
  font-size: 0.86rem;
}

.chat-media-visual {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 0.65rem;
  border-radius: 7px;
  background: #122033;
  object-fit: contain;
}

video.chat-media-visual {
  aspect-ratio: 16 / 9;
}

.chat-audio-player {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: #ffffff;
}

.chat-media-expand {
  display: inline-flex;
  margin-top: 0.65rem;
  border-radius: 7px;
  background: #eef6ff;
  color: #0a4a85;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  padding: 0.45rem 0.65rem;
}

.chat-transcript {
  margin-top: 0.6rem;
  color: #122033;
  font-size: 0.86rem;
}

.chat-transcript summary {
  cursor: pointer;
  color: #0a4a85;
  font-weight: 800;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.6rem;
  padding: 1rem;
  border-top: 1px solid rgba(18, 32, 51, 0.12);
  background: #ffffff;
}

.chat-form input {
  min-height: 46px;
  width: 100%;
  border: 1px solid #000000;
  border-radius: 7px;
  padding: 0.75rem;
  background: #ffffff;
  color: #122033;
  font: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.chat-form input:focus {
  border-color: #0a4a85;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 74, 133, 0.12);
}

.chat-send {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: #122033;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 1rem;
}

.chat-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 48px;
  border-radius: 7px;
  background: #1fa855;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 0.9rem;
  transition: transform 0.2s, background 0.2s;
}

.chat-whatsapp.is-hidden {
  display: none;
}

.chat-whatsapp:hover,
.chat-whatsapp:focus {
  background: #168846;
  color: #ffffff;
  transform: translateY(-2px);
  outline: none;
}

.chat-float {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #0a4a85;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 1.05rem;
  box-shadow: 0 14px 34px rgba(10, 74, 133, 0.28);
}

.chat-float:hover,
.chat-float:focus {
  transform: translateY(-2px);
  outline: none;
}

.chat-register {
  margin-top: 1.1rem;
  text-align: center;
}

.chat-register .button {
  min-width: min(100%, 320px);
  background: #0a4a85;
  color: #ffffff;
  border-color: #0a4a85;
}

.chat-register .button:hover,
.chat-register .button:focus {
  background: #122033;
  color: #ffffff;
  outline: none;
}

@media (max-width: 760px) {
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-whatsapp,
  .chat-send {
    width: 100%;
  }

  .chat-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-chip,
  .chat-whatsapp,
  .chat-float {
    transition: none;
  }
}
