.chat {
  display: grid;
  gap: 12px;
}

.chat-note {
  color: var(--muted);
  font-size: 13px;
}

.chat-hint {
  color: var(--muted);
  font-size: 12px;
}

.chat-window {
  background: var(--chat-shell-bg);
  border: 1px solid var(--chat-shell-border);
  border-radius: 16px;
  padding: 14px;
  min-height: 260px;
  display: grid;
  gap: 10px;
}

.chatgpt {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  max-height: none;
  overflow: hidden;
}

.view[data-view="knowledge"].is-ai-creation {
  height: 100%;
  overflow: hidden;
}

.view[data-view="knowledge"].is-ai-creation.active {
  overflow: hidden;
}

.view[data-view="knowledge"].is-ai-creation > .training-room-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding-inline: 0;
}

.view[data-view="knowledge"].is-ai-creation .chatgpt {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.view[data-view="knowledge"].is-ai-creation > .training-room-shell > .training-room-head,
.view[data-view="knowledge"].is-ai-creation > .training-room-shell > .invite-status {
  padding-inline: 18px;
}

.training-room-head {
  display: grid;
  gap: 8px;
}

.training-composer { min-width: 0; }
.training-composer__feedback {
  padding: 6px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.training-composer__feedback p { margin: 4px 0 0; }
.training-composer__feedback .is-error { color: #ffb3b3; }
.chatgpt.is-keyboard-chat > .training-composer { flex: 0 0 auto; }
.chatgpt.is-keyboard-chat > .training-composer .chatgpt__composer {
  margin: 4px 6px 6px;
  padding: 6px 8px;
}

.training-room-head > .headline,
.training-room-head > .sub,
.training-room-head > .meta {
  margin: 0;
}

.view[data-view="knowledge"].is-ai-creation .chatgpt__messages {
  min-height: 0;
  height: auto;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.view[data-view="knowledge"].is-ai-creation .chatgpt__messages-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.view[data-view="knowledge"].is-ai-creation .chatgpt__messages-inner::before {
  content: "";
  margin-top: auto;
}

.chatgpt--with-tools {
  grid-template-rows: auto 1fr auto;
}

.chatgpt__tools {
  display: flex;
  justify-content: flex-end;
}

.chatgpt__tools .btn {
  padding: 8px 12px;
  border-radius: 10px;
}

.chatgpt__messages {
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.chatgpt__messages::before {
  content: "";
  margin-top: auto;
}

@media (max-width: 768px) {
  .chatgpt__messages {
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
  }
}

.chatgpt__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.chatgpt__composer textarea {
  color: var(--text);
  grid-column: 1;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
}

.chatgpt__composer button {
  cursor: pointer;
}

.chatgpt__composer .mitra-microphone,
.chatgpt__composer .chat-mic-btn {
  grid-column: 2;
}

.chatgpt__composer button:not(.chat-mic-btn) {
  grid-column: 3;
}

.bubble {
  max-width: 100%;
  min-width: 0;
  position: relative;
  align-self: flex-start;
  flex: 0 0 auto;
}

.bubble.user {
  align-self: flex-end;
}

.bubble.user .bubble__body {
  white-space: pre-wrap;
}

.bubble.bot {
  align-self: flex-start;
  width: 100%;
}

.bubble .timestamp {
  display: block;
}

.bubble__body {
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble__body h3,
.bubble__body h4,
.bubble__body h5 {
  margin: 0 0 6px;
  line-height: 1.35;
}

.bubble__body h3 {
  font-size: 15px;
}

.bubble__body h4 {
  font-size: 14px;
}

.bubble__body h5 {
  font-size: 13px;
}

.bubble__body p {
  margin: 0 0 8px;
}

.bubble__body ul {
  margin: 0 0 8px 18px;
  padding: 0;
}

.bubble__body ol {
  margin: 0 0 8px 18px;
  padding: 0;
}

.bubble__body li {
  margin: 0 0 4px;
}

.bubble__body hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin: 10px 0;
}

.bubble__body a {
  color: #9bc2ff;
  text-decoration: underline;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.bubble__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1px 5px;
}

.bubble__body pre {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow-x: auto;
}

.bubble__body pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.proposal-confirmation {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(14, 16, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.proposal-confirmation__eyebrow {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proposal-confirmation__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.proposal-confirmation__meta,
.proposal-confirmation__summary {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.45;
}

.proposal-confirmation__summary {
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
}

.proposal-confirmation__content {
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  max-height: 220px;
  overflow-y: auto;
}

.proposal-confirmation__field {
  display: inline-grid;
  gap: 6px;
  justify-self: start;
  align-items: start;
  max-width: min(100%, 220px);
}

.proposal-confirmation__field-label {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 600;
}

.proposal-confirmation__select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: min(100%, 220px);
  min-width: 140px;
  padding: 8px 34px 8px 12px;
  font: inherit;
}

.proposal-confirmation__select:disabled {
  opacity: 0.56;
  cursor: default;
}

.proposal-confirmation .custom-dropdown {
  width: min(100%, 220px);
}

.proposal-confirmation .custom-dropdown__trigger {
  min-width: 140px;
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 640px) {
  .proposal-confirmation__field {
    display: grid;
    max-width: 100%;
  }

  .proposal-confirmation__select {
    width: 100%;
    min-width: 0;
  }

  .proposal-confirmation .custom-dropdown {
    width: 100%;
  }
}

.proposal-confirmation__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.proposal-confirmation__button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 16px;
  min-width: 104px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.proposal-confirmation__button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.proposal-confirmation__button:disabled {
  opacity: 0.56;
  cursor: default;
}

.proposal-confirmation__button--primary {
  background: rgba(255, 255, 255, 0.94);
  color: #0f1116;
  border-color: rgba(255, 255, 255, 0.9);
}

.proposal-confirmation__button--primary:hover:not(:disabled) {
  background: #fff;
  border-color: #fff;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 60%;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: typingPulse 1.15s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  display: none;
}

.typing-dot:nth-child(3) {
  display: none;
}

@keyframes typingPulse {
  0%,
  100% {
    transform: scale(0.72);
    opacity: 0.32;
  }

  50% {
    transform: scale(1);
    opacity: 0.9;
  }
}

@media (max-width: 900px) {
  .view[data-view="knowledge"].is-ai-creation > .training-room-shell > .training-room-head,
  .view[data-view="knowledge"].is-ai-creation > .training-room-shell > .invite-status {
    padding-inline: 12px;
  }
}

.training-composer__files {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 0;
  min-width: 0;
  font-size: 12px;
}
.training-composer__files span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.training-composer__files button {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.training-composer__files [hidden] { display:none; }
.training-text-attachment { min-width:0; white-space:normal; }
.training-text-attachment summary { cursor:pointer; overflow-wrap:anywhere; }
.training-text-attachment pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow: auto;
  font: inherit;
}
