/* Chat is a focused workspace inside the PowerAI shell. */

.chat-workspace {
  background: #f2f3ef;
}

.chat-conversation-bar {
  position: relative;
  z-index: 6;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 14px;
  border-bottom: 1px solid #dde1da;
  background: rgba(248, 249, 246, .9);
  backdrop-filter: blur(16px);
}

.chat-conversation-bar .chat-history-open {
  position: static;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.chat-main.history-open .chat-conversation-bar .chat-history-open {
  display: grid;
  visibility: hidden;
}

.chat-conversation-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-conversation-heading > span {
  overflow: hidden;
  color: #7d877f;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .045em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-conversation-heading h2 {
  overflow: hidden;
  margin: 0;
  color: #222b25;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.018em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversation-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-conversation-actions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d9ded7;
  border-radius: 10px;
  background: rgba(255, 255, 255, .62);
  color: #526058;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.chat-conversation-actions button:hover {
  border-color: #c6cec5;
  background: #fff;
  color: #263129;
}

.chat-conversation-actions button.primary {
  border-color: #24332b;
  background: #24332b;
  color: #f8faf7;
}

.chat-conversation-actions button.primary:hover { background: #30443a; }
.chat-conversation-actions .shell-icon { width: 14px; height: 14px; }

.chat-main.history-manager-open .chat-conversation-bar,
.chat-main.history-manager-open .chat-scroll-latest {
  display: none;
}

.chat-messages {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
  padding: 34px max(24px, calc((100% - 940px) / 2)) 44px;
  background:
    radial-gradient(circle at 78% -5%, rgba(217, 245, 111, .13), transparent 28%),
    linear-gradient(145deg, #f6f7f3 0%, #f1f2ed 100%);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c8cec6 transparent;
}

.chat-message {
  width: min(100%, 820px);
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #263029;
  font-size: 15px;
  line-height: 1.7;
}

.chat-message.assistant {
  align-self: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(211, 217, 209, .72);
}

.chat-message.assistant:last-child { border-bottom-color: transparent; }

.chat-message.user {
  position: relative;
  align-self: flex-end;
  width: fit-content;
  max-width: min(560px, 68%);
  margin: 0 max(0px, calc((100% - 820px) / 2)) 0 auto;
  padding: 11px 78px 12px 14px;
  border: 1px solid #d7ddd6;
  border-radius: 16px 16px 5px 16px;
  background: #e7eae5;
  color: #29342c;
  box-shadow: 0 4px 12px rgba(30, 42, 34, .045);
}

.chat-message-identity {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #2b362f;
  font-size: 11px;
}

.chat-message-identity strong { font-weight: 720; }

.chat-message-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: -.04em;
}

.chat-message-avatar.assistant {
  background: #d9f56f;
  color: #1d281b;
  box-shadow: inset 0 0 0 1px rgba(50, 66, 40, .08);
}

.chat-message-verified {
  color: #89928b;
  font-size: 10px;
  font-weight: 560;
}

.chat-message.user .chat-message-identity {
  min-height: 22px;
  margin-bottom: 6px;
  color: #39463d;
}

.chat-message-avatar.user {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid #d3d9d2;
  background: rgba(255, 255, 255, .72);
  color: #536159;
  font-size: 9px;
}

.chat-message-content {
  overflow-wrap: anywhere;
}

.chat-message.assistant > .chat-message-content,
.chat-message.assistant > .chat-reference-cards,
.chat-message.assistant > .chat-message-actions,
.chat-message.assistant > .chat-stream-status,
.chat-message.assistant > .chat-image-progress-card {
  margin-left: 36px;
}

.chat-message.assistant > .chat-reference-cards { margin-top: 14px; }

.chat-message-content p { margin: 0 0 14px; }
.chat-message-content p:last-child { margin-bottom: 0; }

.chat-message-content h1,
.chat-message-content h2,
.chat-message-content h3,
.chat-message-content h4 {
  margin: 24px 0 9px;
  color: #1d261f;
  font-weight: 690;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.chat-message-content h1:first-child,
.chat-message-content h2:first-child,
.chat-message-content h3:first-child { margin-top: 0; }
.chat-message-content h1 { font-size: 24px; }
.chat-message-content h2 { font-size: 20px; }
.chat-message-content h3 { font-size: 17px; }
.chat-message-content h4 { font-size: 15px; }

.chat-message-content ul,
.chat-message-content ol {
  margin: 8px 0 16px;
  padding-left: 24px;
}

.chat-message-content li { margin: 5px 0; padding-left: 2px; }
.chat-message-content li::marker { color: #718077; }

.chat-message-content blockquote {
  margin: 16px 0;
  padding: 9px 14px;
  border-left: 3px solid #9cb5a4;
  border-radius: 0 8px 8px 0;
  background: rgba(231, 236, 230, .72);
  color: #536158;
}

.chat-message-content hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: #dce1da;
}

.chat-message-content pre {
  margin: 15px 0;
  padding: 16px 18px;
  border: 1px solid #26362e;
  border-radius: 13px;
  background: #17221c;
  color: #eef5ef;
  box-shadow: 0 12px 28px rgba(22, 31, 25, .1);
  font-size: 13px;
}

.chat-message-content p code {
  border: 1px solid #d9ded7;
  background: #edf0eb;
  color: #3d4b42;
}

.chat-message-actions {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  opacity: .35;
  transition: opacity .15s ease;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions { opacity: 1; }

.chat-message-action {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #7c877f;
}

.chat-message-action:hover,
.chat-message-action:focus-visible {
  border-color: #d7ddd6;
  background: rgba(255, 255, 255, .68);
}

.chat-message.user .chat-message-actions {
  position: absolute;
  top: 8px;
  right: 9px;
  min-height: 26px;
  justify-content: flex-end;
  margin: 0;
  opacity: .18;
}

.chat-message.user .chat-message-action {
  width: 27px;
  height: 27px;
  color: #6f7c73;
}

.chat-message.user .chat-message-action:hover,
.chat-message.user .chat-message-action:focus-visible {
  border-color: #cbd2ca;
  background: rgba(255, 255, 255, .68);
  color: #29352d;
}

.chat-message.user .chat-message-action.copied { color: #315e4a; }

.chat-message.user .chat-message-content p code {
  border-color: #ced5cd;
  background: #dce1db;
  color: #344139;
}

.chat-message.user .chat-message-content .concord-doc-link {
  background: rgba(69, 105, 86, .1);
  color: #41624f;
}

.chat-message.error {
  padding: 15px;
  border: 1px solid #ebc7c2;
  border-radius: 14px;
  background: #fcf2f0;
}

.chat-message.error .chat-message-avatar.assistant { background: #f2c5bf; color: #773e38; }
.chat-message.error .chat-message-content { color: #873f38; }

.chat-stream-status {
  margin-top: 12px;
  color: #6f7b72;
  font-size: 12px;
  font-weight: 620;
}

.chat-stream-status[hidden] { display: none; }

.thinking-dots i { background: #526f5d; }

/* Image generation */

.chat-image-progress-card {
  width: min(560px, calc(100% - 36px));
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #d5ddd4;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(253, 254, 251, .98), rgba(244, 247, 241, .98));
  color: #263129;
  box-shadow: 0 18px 48px rgba(29, 40, 32, .1);
}

.chat-image-progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 11px 14px;
  border-bottom: 1px solid #e1e6df;
  background: rgba(255, 255, 255, .62);
}

.chat-image-progress-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: #dff477;
  color: #26351f;
  box-shadow: inset 0 0 0 1px rgba(46, 68, 31, .08);
}

.chat-image-progress-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.chat-image-progress-header > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.chat-image-progress-header small { color: #8a948b; font-size: 8px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.chat-image-progress-header strong { overflow: hidden; font-size: 14px; font-weight: 720; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }

.chat-image-progress-live {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid #d7dfd2;
  border-radius: 999px;
  background: #f5f8ef;
  color: #58704d;
  font-size: 8px;
  font-weight: 700;
}

.chat-image-progress-live i { width: 6px; height: 6px; border-radius: 50%; background: #7a9d5e; box-shadow: 0 0 0 0 rgba(122, 157, 94, .34); animation: chat-image-live-pulse 1.8s ease-out infinite; }

.chat-image-progress-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.chat-image-progress-canvas {
  position: relative;
  min-height: 136px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background:
    radial-gradient(circle at 23% 18%, rgba(221, 244, 119, .23), transparent 35%),
    linear-gradient(145deg, #243029, #101612);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  isolation: isolate;
}

.chat-image-progress-orb { position: absolute; border-radius: 50%; filter: blur(1px); opacity: .8; animation: chat-image-orbit 5s ease-in-out infinite alternate; }
.chat-image-progress-orb.one { width: 92px; height: 92px; top: -30px; right: -18px; background: rgba(202, 236, 112, .2); }
.chat-image-progress-orb.two { width: 74px; height: 74px; bottom: -28px; left: -18px; background: rgba(115, 173, 152, .2); animation-delay: -2s; }

.chat-image-progress-shimmer {
  position: absolute;
  z-index: 1;
  inset: -40% auto -40% -45%;
  width: 42%;
  transform: rotate(16deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.11), transparent);
  animation: chat-image-shimmer 2.5s ease-in-out infinite;
}

.chat-image-progress-placeholder { position: relative; z-index: 2; width: 38px; height: 38px; fill: none; stroke: rgba(239, 245, 239, .8); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.25; }

.chat-image-progress-details { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.chat-image-progress-details > span { color: #879188; font-size: 8px; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
.chat-image-progress-details p { display: -webkit-box; overflow: hidden; margin: 5px 0 8px; color: #354139; font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.chat-image-progress-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.chat-image-progress-meta span { padding: 3px 6px; border: 1px solid #dce2da; border-radius: 6px; background: rgba(255,255,255,.7); color: #6d786f; font-size: 7.5px; font-weight: 650; text-transform: capitalize; }

.chat-image-progress-steps { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; padding-top: 12px; }
.chat-image-progress-steps span { position: relative; min-width: 0; padding-top: 9px; color: #a0a7a0; font-size: 7.5px; font-weight: 650; white-space: nowrap; }
.chat-image-progress-steps span::before { content: ""; position: absolute; top: 2px; right: 0; left: 8px; height: 1px; background: #d9dfd8; }
.chat-image-progress-steps span:last-child::before { display: none; }
.chat-image-progress-steps i { position: absolute; z-index: 1; top: -1px; left: 0; width: 7px; height: 7px; border: 2px solid #f7f9f5; border-radius: 50%; background: #cbd2cb; box-shadow: 0 0 0 1px #cbd2cb; }
.chat-image-progress-steps .complete { color: #687563; }
.chat-image-progress-steps .complete i { background: #8aa36d; box-shadow: 0 0 0 1px #8aa36d; }
.chat-image-progress-steps .active { color: #344a2b; }
.chat-image-progress-steps .active i { background: #d9f56f; box-shadow: 0 0 0 1px #78935e, 0 0 0 4px rgba(217, 245, 111, .22); animation: chat-image-step-pulse 1.6s ease-in-out infinite; }

.chat-image-progress-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid #e1e6df;
  background: rgba(246, 248, 244, .82);
}

.chat-image-progress-footer > span { min-width: 0; display: grid; gap: 1px; }
.chat-image-progress-footer strong { color: #536158; font-size: 9px; font-weight: 690; }
.chat-image-progress-footer small { overflow: hidden; color: #909991; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.chat-image-progress-footer button { height: 31px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid #d4dad3; border-radius: 8px; background: rgba(255,255,255,.78); color: #69736c; font: inherit; font-size: 8px; font-weight: 680; cursor: pointer; }
.chat-image-progress-footer button:hover:not(:disabled),
.chat-image-progress-footer button:focus-visible { border-color: #aab5ab; background: #fff; color: #344039; outline: none; }
.chat-image-progress-footer button:disabled { cursor: wait; opacity: .55; }
.chat-image-progress-footer button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }

.chat-reference-cards .filestore-image-reference {
  max-width: min(560px, 100%);
  gap: 0;
  padding: 8px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(252, 253, 250, .94);
}

.chat-reference-cards .filestore-image-reference.generated { border-color: #ced9cd; }
.filestore-image-reference .chat-reference-card-preview { position: relative; aspect-ratio: 16 / 10; border: 0; border-radius: 12px; background: #182019; }
.filestore-image-reference .chat-reference-card-preview img { object-fit: contain; transition: transform .22s ease; }
.filestore-image-reference:hover .chat-reference-card-preview img { transform: scale(1.015); }

.chat-image-reference-open {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(20, 27, 22, .78);
  color: #f4f7f4 !important;
  font-size: 8px !important;
  font-weight: 680;
  opacity: 0;
  transform: translateY(3px);
  backdrop-filter: blur(8px);
  transition: opacity .16s ease, transform .16s ease;
}

.filestore-image-reference:hover .chat-image-reference-open,
.filestore-image-reference:focus-visible .chat-image-reference-open { opacity: 1; transform: translateY(0); }
.chat-image-reference-open svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.chat-image-reference-copy { min-width: 0; display: grid; gap: 2px; padding: 11px 8px 6px; }
.chat-image-reference-copy .chat-reference-card-kicker { color: #617765; font-size: 8px; letter-spacing: .08em; }
.chat-image-reference-copy strong { overflow: hidden; color: #263129; font-size: 12px; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.chat-image-reference-copy small { color: #8c958e; font-size: 8px; }

@keyframes chat-image-live-pulse { 70% { box-shadow: 0 0 0 6px rgba(122, 157, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(122, 157, 94, 0); } }
@keyframes chat-image-orbit { to { transform: translate3d(8px, 6px, 0) scale(1.08); } }
@keyframes chat-image-shimmer { 0% { left: -55%; } 65%, 100% { left: 130%; } }
@keyframes chat-image-step-pulse { 50% { box-shadow: 0 0 0 1px #78935e, 0 0 0 6px rgba(217, 245, 111, .1); } }

@media (max-width: 640px) {
  .chat-image-progress-card { width: 100%; border-radius: 15px; }
  .chat-image-progress-body { grid-template-columns: 1fr; }
  .chat-image-progress-canvas { min-height: 120px; }
  .chat-image-progress-live { padding: 5px 7px; }
  .chat-image-progress-footer small { white-space: normal; }
  .chat-image-reference-open { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-image-progress-live i,
  .chat-image-progress-orb,
  .chat-image-progress-shimmer,
  .chat-image-progress-steps .active i { animation: none; }
}

.chat-reference-cards {
  max-width: min(600px, calc(100% - 36px));
  gap: 10px;
}

.chat-reference-card {
  padding: 15px 16px;
  border-color: #d9dfd7;
  border-radius: 13px;
  background: rgba(252, 253, 250, .88);
  box-shadow: 0 8px 24px rgba(23, 31, 26, .055);
}

.chat-reference-card:hover,
.chat-reference-card:focus-visible {
  border-color: #aebeb1;
  box-shadow: 0 14px 30px rgba(23, 31, 26, .09);
}

.chat-reference-card-kicker { color: #53715f; }

.chat-welcome {
  width: min(860px, 100%);
  min-height: min(620px, 100%);
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  padding: 38px 8px 44px;
  color: #69746b;
  text-align: left;
}

.chat-welcome-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 15px;
  background: #d9f56f;
  color: #1c281a;
  box-shadow: 0 12px 30px rgba(41, 53, 34, .12);
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.08em;
}

.chat-welcome-eyebrow {
  margin-bottom: 8px;
  color: #768177;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.chat-welcome h2 {
  max-width: 700px;
  margin: 0;
  color: #182019;
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 660;
  letter-spacing: -.05em;
  line-height: 1.05;
}

.chat-welcome > p {
  max-width: 620px;
  margin: 14px 0 0;
  color: #69746b;
  font-size: 15px;
  line-height: 1.6;
}

.chat-starter-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 30px;
}

.chat-starter-grid button {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid #dce1da;
  border-radius: 14px;
  background: rgba(252, 253, 250, .72);
  color: #273129;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.chat-starter-grid button:hover {
  transform: translateY(-2px);
  border-color: #c4cec3;
  background: #fcfdfa;
  box-shadow: 0 12px 28px rgba(23, 31, 26, .07);
}

.chat-starter-grid > button > .shell-icon {
  width: 15px;
  height: 15px;
  color: #8a948c;
}

.chat-starter-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e7eddf;
  color: #4e6755;
}

.chat-starter-icon.concord { background: #e4ebf7; color: #4c6686; }
.chat-starter-icon.floweave { background: #dfeeea; color: #3d6b63; }
.chat-starter-icon.drive { background: #f4e8d6; color: #775d39; }
.chat-starter-icon .shell-icon { width: 17px; height: 17px; }

.chat-starter-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-starter-copy strong { font-size: 12px; font-weight: 690; }
.chat-starter-copy small {
  overflow: hidden;
  color: #7a857c;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-welcome-capabilities {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  color: #899189;
  font-size: 10px;
}

.chat-welcome-capabilities span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8aaa75;
  box-shadow: 0 0 0 3px rgba(138, 170, 117, .14);
}

.chat-scroll-latest {
  position: absolute;
  z-index: 8;
  right: 24px;
  bottom: 126px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #d5dbd4;
  border-radius: 18px;
  background: rgba(252, 253, 250, .94);
  color: #4f5d54;
  box-shadow: 0 8px 24px rgba(23, 31, 26, .12);
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.chat-scroll-latest:hover { background: #fff; color: #263129; }
.chat-scroll-latest .shell-icon { width: 13px; height: 13px; }

.chat-input-bar {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  padding: 12px 24px 14px;
  border-top: 0;
  background: linear-gradient(180deg, rgba(242, 243, 238, 0), rgba(242, 243, 238, .96) 24%, #f2f3ee 58%);
}

.chat-composer-main {
  width: min(860px, 100%);
  display: grid;
  gap: 4px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #d1d8d0;
  border-radius: 18px;
  background: rgba(253, 254, 251, .96);
  box-shadow: 0 14px 36px rgba(23, 31, 26, .09), 0 2px 8px rgba(23, 31, 26, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.chat-composer-main:focus-within {
  border-color: #9faf9f;
  box-shadow: 0 18px 44px rgba(22, 31, 25, .12), 0 0 0 3px rgba(111, 143, 119, .09);
}

.chat-input-bar.is-editing-message .chat-composer-main {
  border-color: #9eae9f;
  box-shadow: 0 18px 44px rgba(22, 31, 25, .11), 0 0 0 3px rgba(111, 143, 119, .08);
}

.chat-composer-edit-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 4px;
  padding: 7px 8px 7px 11px;
  border: 1px solid #d8dfd6;
  border-radius: 11px;
  background: #f0f4ed;
}

.chat-composer-edit-bar > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.chat-composer-edit-bar strong {
  color: #3c4b41;
  font-size: 10px;
  font-weight: 700;
}

.chat-composer-edit-bar small {
  overflow: hidden;
  color: #7b877e;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer-edit-bar button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5e6c63;
  font-size: 9px;
  font-weight: 680;
  cursor: pointer;
}

.chat-composer-edit-bar button:hover { background: #e0e7de; color: #2f3d34; }

.chat-input-bar.is-dragging-files .chat-composer-main {
  border-color: #63866f;
  background: #f7fbf5;
  box-shadow: 0 0 0 4px rgba(99, 134, 111, .13), 0 18px 44px rgba(22, 31, 25, .11);
  transform: translateY(-2px);
}

.chat-input-bar.is-busy .chat-composer-main { background: #fafbf8; }

.chat-input-bar textarea {
  width: 100%;
  min-height: 48px;
  max-height: 184px;
  display: block;
  padding: 11px 12px 7px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #222b25;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.chat-input-bar textarea::placeholder { color: #929a93; }
.chat-input-bar textarea:disabled { cursor: not-allowed; opacity: .65; }

.chat-composer-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 2px 0;
}

.chat-composer-tools,
.chat-composer-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attach-btn,
.chat-active-model,
.stop-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #69756c;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.attach-btn:hover,
.chat-active-model:hover,
.stop-btn:hover { background: #edf0eb; color: #2d3931; }

.attach-btn > span:first-child {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid #d7ddd6;
  border-radius: 7px;
  background: #fff;
  font-size: 16px;
  font-weight: 420;
  line-height: 1;
}

.attach-btn:disabled { cursor: not-allowed; opacity: .45; }

.chat-active-model {
  max-width: 250px;
  text-align: left;
}

.chat-active-model:empty { display: none; }
.chat-active-model .shell-icon { width: 14px; height: 14px; color: #607b68; }
.chat-active-model > span { min-width: 0; display: flex; align-items: baseline; gap: 5px; }
.chat-active-model strong {
  overflow: hidden;
  color: #46534a;
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-active-model small { color: #909890; font-size: 9px; }

.chat-composer-hint {
  color: #969e97;
  font-size: 9px;
  white-space: nowrap;
}

.send-btn {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: #dfe4de;
  color: #96a098;
  font-size: 19px;
  line-height: 1;
  cursor: not-allowed;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.send-btn.ready {
  background: #24332b;
  color: #f7faf7;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 47, 38, .16);
}

.send-btn.ready:hover { transform: translateY(-1px); background: #30443a; }
.send-btn:disabled { pointer-events: none; }

.stop-btn {
  padding-right: 10px;
  background: #f7eae7;
  color: #9a4d45;
}

.stop-btn > span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

.chat-composer-disclaimer {
  width: min(860px, 100%);
  margin: 6px auto 0;
  color: #929a93;
  font-size: 9px;
  text-align: center;
}

.chat-attachment-tray {
  display: flex;
  gap: 7px;
  padding: 2px 3px 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chat-attachment-card {
  position: relative;
  width: 240px;
  min-width: 210px;
  min-height: 54px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 31px 6px 6px;
  border: 1px solid #dce1da;
  border-radius: 11px;
  background: #f5f7f3;
}

.chat-attachment-preview {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
}

.chat-attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.chat-attachment-file-icon { width: 27px; height: 27px; display: grid; place-items: center; color: #748078; }
.chat-attachment-file-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.chat-attachment-meta { min-width: 0; }
.chat-attachment-name {
  overflow: hidden;
  color: #39453d;
  font-size: 10px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-attachment-kind { color: #89928a; font-size: 9px; }
.chat-attachment-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 21px;
  height: 21px;
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7b857d;
  font-size: 14px;
  cursor: pointer;
}
.chat-attachment-remove:hover { background: #e5e9e3; color: #313d35; }

.chat-conversation-bar button:focus-visible,
.chat-scroll-latest:focus-visible,
.chat-composer-main button:focus-visible,
.chat-starter-grid button:focus-visible {
  outline: 2px solid #75906f;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .chat-conversation-bar {
    min-height: 58px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    padding: 7px 9px 7px 8px;
  }

  .chat-conversation-heading > span { font-size: 8px; }
  .chat-conversation-heading h2 { font-size: 12px; }
  .chat-conversation-actions button { width: 34px; padding: 0; }
  .chat-conversation-actions .chat-cost-pill { width: auto; padding: 6px 9px; }
  .chat-conversation-actions button span { display: none; }

  .chat-messages {
    gap: 22px;
    padding: 24px 14px 38px;
    scrollbar-gutter: auto;
  }

  .chat-message { font-size: 14px; }
  .chat-message.assistant { padding-bottom: 19px; }
  .chat-message.user { max-width: 88%; margin-right: 0; }
  .chat-message.assistant > .chat-message-content,
  .chat-message.assistant > .chat-reference-cards,
  .chat-message.assistant > .chat-message-actions,
  .chat-message.assistant > .chat-stream-status,
  .chat-message.assistant > .chat-image-progress-card { margin-left: 0; }
  .chat-message.assistant > .chat-reference-cards { max-width: 100%; }

  .chat-welcome {
    min-height: auto;
    justify-content: flex-start;
    padding: 30px 2px 28px;
  }

  .chat-welcome-mark { width: 42px; height: 42px; margin-bottom: 18px; }
  .chat-welcome h2 { font-size: 32px; }
  .chat-welcome > p { font-size: 13px; }
  .chat-starter-grid { grid-template-columns: 1fr; margin-top: 24px; }
  .chat-starter-grid button { min-height: 68px; }

  .chat-input-bar { padding: 9px 10px 11px; }
  .chat-composer-main { border-radius: 16px; }
  .chat-input-bar textarea { min-height: 44px; padding: 9px 9px 6px; font-size: 16px; }
  .chat-composer-hint,
  .chat-composer-disclaimer,
  .chat-active-model small { display: none; }
  .chat-active-model { max-width: 150px; }
  .attach-btn > span:last-child { display: none; }
  .chat-scroll-latest { right: 14px; bottom: 103px; }
}

@media (max-width: 420px) {
  .chat-message.user { max-width: 92%; }
  .chat-welcome h2 { font-size: 29px; }
  .chat-welcome-capabilities { align-items: flex-start; }
  .chat-active-model { max-width: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-workspace *,
  .chat-workspace *::before,
  .chat-workspace *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
