/* Atlas Day 4.9.5 — compact chat composer and contained poll results. */

.neo-chat .neo-chat-cover .atlas-duplicate-poll {
  display: none !important;
}

.neo-chat .chat-compose {
  padding: 12px 14px 14px;
}

.neo-chat .compose-tools.atlas-unified-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
  margin: 0 0 11px;
  padding: 1px 2px 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.neo-chat .compose-tools.atlas-unified-tools::-webkit-scrollbar {
  display: none;
}

.neo-chat .compose-tools.atlas-unified-tools > button,
.neo-chat .compose-tools.atlas-unified-tools > label {
  flex: 0 0 auto;
}

.neo-chat .compose-row {
  align-items: flex-end;
  gap: 12px;
  margin: 0;
}

.neo-chat .compose-row textarea {
  min-height: 46px;
  margin: 0;
  padding: 12px 15px;
}

.neo-chat .chat-send,
.neo-chat .compose-row > button {
  flex: 0 0 auto;
  margin: 0;
}

.neo-chat .poll-composer.atlas-poll-sheet {
  flex: 0 0 auto;
  gap: 10px;
  max-height: min(48vh, 430px);
  margin: 0 14px 12px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid rgba(96, 239, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(1, 7, 24, 0.28);
}

.neo-chat .poll-composer.atlas-poll-sheet > div {
  gap: 10px;
}

.neo-chat .poll-composer.atlas-poll-sheet > div:first-child {
  align-items: center;
}

.neo-chat .poll-composer.atlas-poll-sheet input {
  min-height: 44px;
  padding: 10px 12px;
}

.neo-chat .poll-composer.atlas-poll-sheet .poll-option-draft {
  gap: 8px;
}

.neo-chat .poll-composer.atlas-poll-sheet > div:last-child {
  align-items: center;
  margin-top: 2px;
}

.neo-chat .poll-composer.atlas-poll-sheet > div:last-child button {
  min-height: 40px;
}

.neo-chat .poll-composer .atlas-poll-close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

/* Poll results must size against the message column, never against the viewport. */
.neo-chat .chat-message:has(.chat-poll) {
  box-sizing: border-box;
  width: min(86%, 420px);
  min-width: 0;
  max-width: min(86%, 420px);
  overflow: hidden;
}

.neo-chat .chat-poll {
  box-sizing: border-box;
  width: 100%;
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
}

.neo-chat .chat-poll button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid rgba(96, 239, 255, 0.42);
}

.neo-chat .chat-poll button i {
  z-index: 0;
  max-width: 100%;
  border-radius: 11px 0 0 11px;
}

.neo-chat .chat-poll button b,
.neo-chat .chat-poll button strong {
  position: relative;
  z-index: 1;
}

.neo-chat .chat-poll button b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.neo-chat .chat-poll button strong {
  display: block;
  min-width: 38px;
  color: #f2fdff;
  text-align: right;
  white-space: nowrap;
  opacity: 1;
}

.neo-chat .chat-poll button.selected {
  border-color: #00ff87;
}

.video-circle-shell .atlas-video-load-state {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.66));
  transition: opacity 180ms ease;
}

.video-circle-shell[data-video-state="loading"] .atlas-video-load-state,
.video-circle-shell[data-video-state="error"] .atlas-video-load-state {
  opacity: 1;
}

.video-circle-shell .atlas-video-load-state i {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.36);
  border-top-color: #60efff;
  border-radius: 50%;
  animation: atlas-video-spin 800ms linear infinite;
}

.video-circle-shell[data-video-state="error"] .atlas-video-load-state i {
  animation: none;
  border-color: #fb7185;
}

.video-circle-shell[data-video-state="ready"] .atlas-video-load-state {
  visibility: hidden;
}

@keyframes atlas-video-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  body.atlas-mobile-chat-open .neo-chat .chat-message:has(.chat-poll) {
    width: min(88%, 360px);
    min-width: 0;
    max-width: min(88%, 360px);
  }

  body.atlas-mobile-chat-open .neo-chat .chat-poll button {
    min-height: 46px;
    padding: 10px 11px;
  }

  body.atlas-mobile-chat-open .neo-chat .chat-compose {
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  }

  body.atlas-mobile-chat-open .neo-chat .compose-tools.atlas-unified-tools {
    gap: 9px;
    margin-bottom: 11px;
    padding-inline: 1px;
  }

  body.atlas-mobile-chat-open .neo-chat .compose-row {
    gap: 10px;
  }

  body.atlas-mobile-chat-open .neo-chat .compose-row textarea {
    min-height: 48px;
    padding: 12px 14px;
  }

  body.atlas-mobile-chat-open .neo-chat .poll-composer.atlas-poll-sheet {
    max-height: min(42dvh, 390px);
    margin: 0 8px 10px;
    padding: 13px;
    border-radius: 17px;
  }

  body.atlas-mobile-chat-open .neo-chat .poll-composer.atlas-poll-sheet > div:last-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-circle-shell .atlas-video-load-state i {
    animation-duration: 1600ms;
  }
}
