:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #181b1f;
  --line: #292e35;
  --text: #f3f5f7;
  --muted: #8e98a6;
  --red: #e64655;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    Segoe UI,
    system-ui,
    sans-serif;
}
.fm-view-redchat > main.redchat-shell {
  width: auto !important;
  max-width: none !important;
  margin-left: var(--fm-side) !important;
  padding: calc(var(--fm-head) + 30px) 32px 36px !important;
  overflow-x: hidden;
}
.redchat-shell {
  width: min(1050px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 28px;
}
.chat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #1d2024, #181a1e);
}
.chat-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.redchat-mark {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border: 1px solid #593139;
  border-radius: 15px;
  background: linear-gradient(145deg, #3a1c23, #24171b);
  color: #ff7c89;
  font-size: 21px;
}
.chat-top small,
.chat-wallet small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #a0a9b7;
}
.chat-top h2 {
  margin: 8px 0 5px;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.035em;
}
.chat-top p {
  margin: 0;
  color: var(--muted);
}
.chat-wallet {
  min-width: 175px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}
.chat-wallet b,
.chat-wallet span {
  display: block;
}
.chat-wallet b {
  margin: 3px 0;
  font-size: 20px;
}
.chat-wallet span {
  font-size: 12px;
  color: var(--muted);
}
.conversation {
  width: 100%;
  max-width: 1180px;
  min-height: 430px;
  max-height: calc(100vh - 380px);
  margin: 0 auto 16px;
  overflow: auto;
  padding: 34px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 50% 15%,
      rgba(230, 70, 85, 0.045),
      transparent 36%
    ),
    #15171a;
  scroll-behavior: smooth;
}
.redchat-workspace {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.delivery-style {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #aab3bf;
  font: 9px "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}
.delivery-style i {
  color: #ff7c89;
  font-size: 14px;
}
.delivery-style select {
  max-width: 142px;
  padding: 7px 24px 7px 8px;
  border: 1px solid #4a3037;
  border-radius: 7px;
  background: #24171b;
  color: #ffdfe2;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0;
}
.delivery-cue {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 3px 7px;
  border: 1px solid #70404a;
  border-radius: 999px;
  background: #2a1b20;
  color: #ff9eaa;
  font-size: 0.86em;
  font-style: italic;
}
.chat-main {
  min-width: 0;
}
.chat-history {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #181a1e;
}
.chat-history > button {
  width: 100%;
  padding: 12px;
  border: 1px solid #66313a;
  border-radius: 11px;
  background: #341c22;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.chat-history > small {
  display: block;
  margin: 22px 7px 10px;
  color: #737d88;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
#conversationList {
  display: grid;
  gap: 5px;
}
#conversationList > p {
  padding: 8px;
  color: #737d88;
  font-size: 11px;
  line-height: 1.5;
}
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 4px;
  border-radius: 10px;
}
.history-item.active {
  background: #242126;
}
.history-item button {
  border: 0;
  background: transparent;
  color: #8f99a5;
  cursor: pointer;
}
.history-open {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 9px;
  text-align: left;
}
.history-open span {
  overflow: hidden;
  color: #c7cdd3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-delete {
  opacity: 0;
  border-radius: 8px !important;
}
.history-item:hover .history-delete {
  opacity: 1;
}
.history-delete:hover {
  background: #422129 !important;
  color: #ff7885 !important;
}
.history-loading {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: #828c97;
}
.welcome {
  text-align: center;
  margin: 80px auto;
  color: var(--muted);
}
.welcome > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  border: 1px solid #353b44;
  border-radius: 18px;
  background: #1b1f24;
  color: #f26a75;
  font-size: 23px;
}
.welcome h3 {
  margin: 0 0 8px;
  color: var(--text);
}
.welcome p {
  max-width: 480px;
  margin: auto;
  line-height: 1.55;
}
.prompt-starters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 28px auto 0;
}
.prompt-starters button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 112px;
  padding: 17px;
  border: 1px solid #30353c;
  border-radius: 13px;
  background: #1b1e22;
  color: #dfe4e9;
  text-align: left;
  cursor: pointer;
}
.prompt-starters button:hover {
  border-color: #5a343b;
  background: #211b1e;
  transform: translateY(-1px);
}
.prompt-starters i {
  color: #ef6875;
  font-size: 18px;
}
.prompt-starters span,
.prompt-starters b,
.prompt-starters small {
  display: block;
  min-width: 0;
}
.prompt-starters button > span {
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.prompt-starters b {
  color: #edf0f2;
  font-size: 12px;
  line-height: 1.25;
}
.prompt-starters small {
  margin-top: 4px;
  color: #7f8996;
  font-size: 10px;
  line-height: 1.35;
}
.message {
  display: flex;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto 24px;
}
.message.user {
  justify-content: flex-end;
}
.bubble {
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  white-space: pre-wrap;
  line-height: 1.58;
  overflow-wrap: anywhere;
}
.user .bubble {
  max-width: 78%;
  border-color: #443036;
  background: #281a1e;
}
.assistant .bubble {
  width: min(100%, 760px);
}
.answer-actions {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.live-response {
  white-space: pre-wrap;
}
.process-bubble {
  width: min(620px, 100%);
  padding: 0 !important;
  overflow: hidden;
  border-color: rgba(255, 80, 107, 0.3) !important;
  background: linear-gradient(145deg, rgba(255, 80, 107, 0.08), rgba(24, 28, 35, 0.98)) !important;
}
.process-bubble details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  cursor: pointer;
  list-style: none;
}
.process-bubble details summary::-webkit-details-marker { display: none; }
.process-heading { display: flex; align-items: center; gap: 9px; }
.process-heading i { color: #ff506b; }
.process-bubble summary small { color: #8f9bad; white-space: nowrap; }
.process-steps {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 5px 17px 14px;
  list-style: none;
}
.process-steps li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 8px;
  color: #778395;
}
.process-steps li > i {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex: none;
  border: 2px solid #586272;
  border-radius: 50%;
}
.process-steps li span,
.process-steps li b,
.process-steps li small { display: block; }
.process-steps li small { margin-top: 3px; }
.process-steps li.active { color: #f1f4fa; background: rgba(255,255,255,0.035); }
.process-steps li.active > i { border-color: #ff506b; box-shadow: 0 0 0 4px rgba(255,80,107,.12); animation: process-pulse 1s infinite; }
.process-steps li.done { color: #aeb8c7; }
.process-steps li.done > i { border-color: #58d69b; background: #58d69b; }
.process-note {
  margin: 0;
  padding: 11px 17px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #778395;
  font-size: 11px;
}
.process-note i { margin-right: 5px; color: #58d69b; }
@keyframes process-pulse { 50% { opacity: .45; } }
.streaming-cursor {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -2px;
  border-radius: 2px;
  background: #ff506b;
  animation: redchat-cursor 0.8s steps(2, end) infinite;
}
@keyframes redchat-cursor {
  50% { opacity: 0; }
}
@media (max-width: 600px) {
  .process-bubble details summary { align-items: flex-start; }
  .process-bubble summary small { white-space: normal; text-align: right; }
}
.answer-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #343a43;
  border-radius: 9px;
  background: #20242a;
  color: #aeb7c4;
  font: 600 12px/1 inherit;
  cursor: pointer;
}
.answer-actions button:hover {
  border-color: #515965;
  color: #fff;
}
.download-answer {
  border-color: #5e3038 !important;
  background: #321c21 !important;
  color: #ff9aa4 !important;
}
.uploaded-file {
  overflow: hidden;
  width: min(100%, 650px);
  margin-top: 13px;
  padding: 9px;
  border: 1px solid #3b4148;
  border-radius: 14px;
  background: #15171a;
}
.uploaded-file-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 4px 5px 11px;
}
.uploaded-file-head > i {
  color: #ff6574;
  font-size: 20px;
}
.uploaded-file-head span {
  min-width: 0;
}
.uploaded-file-head b,
.uploaded-file-head small {
  display: block;
}
.uploaded-file-head b {
  overflow: hidden;
  color: #eef1f3;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uploaded-file-head small {
  margin-top: 3px;
  color: #7f8994;
  font-size: 10px;
}
.uploaded-file-head a {
  flex: 0 0 auto;
  margin-left: auto;
  color: #ff7e89;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}
.uploaded-file > img {
  display: block;
  width: 100%;
  max-height: 620px;
  border-radius: 10px;
  background: #0d0f11;
  object-fit: contain;
}
.user .bubble:has(.uploaded-file) {
  width: min(90%, 700px);
  max-width: 90%;
}
.generated-asset {
  overflow: hidden;
  margin: 14px 0 5px;
  border: 1px solid #343a41;
  border-radius: 14px;
  background: #111315;
}
.generated-asset img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}
.generated-asset figcaption {
  display: flex;
  gap: 8px;
  padding: 10px;
}
.generated-asset a,
.generated-file {
  color: #dce2e8;
  text-decoration: none;
}
.generated-asset a {
  padding: 8px 10px;
  border: 1px solid #363c43;
  border-radius: 8px;
  font-size: 11px;
}
.generated-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 5px;
  padding: 14px;
  border: 1px solid #3a4047;
  border-radius: 12px;
  background: #15181b;
}
.generated-file > i:first-child {
  color: #f06b78;
  font-size: 22px;
}
.generated-file > i:last-child {
  margin-left: auto;
}
.generated-file span,
.generated-file b,
.generated-file small {
  display: block;
}
.generated-file small {
  margin-top: 3px;
  color: #828c97;
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 10px;
  background: #2c171b;
  color: #ff7280;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.thinking i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e65a67;
  animation: think 1.15s infinite;
}
.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes think {
  0%,
  70%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-5px);
  }
}
.composer {
  position: relative;
  padding: 14px;
  border: 1px solid #343a43;
  border-radius: 20px;
  background: #191c20;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.composer:focus-within {
  border-color: #5b626d;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.035),
    0 20px 60px rgba(0, 0, 0, 0.26);
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 62px;
  max-height: 180px;
  resize: none;
  padding: 5px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 16px/1.5 inherit;
}
.composer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.attach-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #aeb7c4;
  cursor: pointer;
}
.attach-button:hover {
  background: #24282e;
}
.attach-button input {
  display: none;
}
.privacy {
  flex: 1;
  color: #727d8c;
  font-size: 12px;
}
.privacy i {
  color: #65bf91;
}
.composer-actions > button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.composer-actions > button:disabled {
  opacity: 0.45;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #343a43;
  border-radius: 10px;
  background: #22262b;
  color: #bac3cf;
  font-size: 13px;
}
.attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment button {
  border: 0;
  background: transparent;
  color: #9ba5b2;
}
.chat-status {
  width: 100%;
  max-width: 1180px;
  min-height: 20px;
  margin: 10px auto;
  padding: 0 8px;
  color: #e77782;
  font-size: 13px;
}
@media (max-width: 720px) {
  .fm-view-redchat > main.redchat-shell {
    margin-left: 0 !important;
    padding: calc(var(--fm-head) + 14px) 12px 24px !important;
  }
  .redchat-shell {
    width: calc(100% - 24px);
    padding-top: 12px;
  }
  .chat-top {
    display: block;
    padding: 18px;
  }
  .chat-heading {
    align-items: flex-start;
  }
  .redchat-mark {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
  .chat-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
  }
  .chat-wallet span {
    margin-left: auto;
  }
  .conversation {
    min-height: 360px;
    max-height: none;
    padding: 22px 14px;
  }
  .redchat-workspace {
    grid-template-columns: 1fr;
  }
  .chat-history {
    padding: 10px;
  }
  #conversationList {
    display: flex;
    overflow-x: auto;
  }
  .history-item {
    flex: 0 0 190px;
  }
  .history-delete {
    opacity: 1;
  }
  .prompt-starters {
    grid-template-columns: 1fr;
  }
  .assistant .avatar {
    display: none;
  }
  .bubble {
    font-size: 14px;
  }
  .privacy {
    display: none;
  }
}
