/* A quiet, white conversation workspace with EK Jewel identity. */
.content:has(.assistant-shell) {
  padding: 0;
  max-width: none;
  background: #fff;
}
.content:has(.assistant-shell) > .demo {
  margin: 12px 20px 0;
}
.content:has(.assistant-shell) > .footer {
  display: none;
}
.main:has(.assistant-shell) {
  background: #fff;
}
.assistant-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  height: calc(100dvh - 88px);
  min-height: 540px;
  background: #fff;
  color: #202123;
}
.content:has(> .demo) .assistant-shell {
  height: calc(100dvh - 148px);
  min-height: 500px;
}
.chat-history {
  background: #fafafa;
  border-right: 1px solid #f0f0f0;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  overflow: auto;
}
.chat-new {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  padding: 12px;
  border-radius: 9px;
  color: #262626;
  text-align: left;
}
.chat-new .i {
  width: 17px;
  height: 17px;
}
.chat-history-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: #a1a1a1;
  padding: 8px 12px 0;
}
.chat-history nav {
  display: grid;
  gap: 4px;
}
.chat-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: #606060;
  text-align: left;
  min-width: 0;
  width: 100%;
}
.chat-history-item .i {
  width: 14px;
  height: 14px;
  color: #8c8c8c;
}
.chat-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-history-item.selected {
  background: #ececec;
  color: #202123;
}
.chat-history-bottom {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid #ededed;
}
.chat-history-bottom p {
  font-size: 9px;
  color: #a1a1a1;
  line-height: 1.8;
  margin-bottom: 14px;
}
.chat-stage {
  background: #fafafa;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px 14px;
  min-height: 78px;
  flex: none;
}
.chat-header > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.chat-header h1 {
  font-size: 17px;
  color: #333;
  font-weight: 500;
  letter-spacing: -0.4px;
}
.chat-mode-label select {
  border: 1px solid #eee;
  background: #fff;
  border-radius: 20px;
  padding: 6px 25px 6px 11px;
  color: #7c7c7c;
  font-size: 10px;
  max-width: 240px;
}
.chat-header-new {
  display: none !important;
}
.chat-messages {
  background: #fafafa;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px max(24px, calc((100% - 760px) / 2));
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.chat-welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 0 50px;
  max-width: 720px;
  margin: auto;
}
.chat-welcome > img {
  width: 74px;
  height: 74px;
  margin-bottom: 18px;
  object-fit: contain;
}
.chat-welcome-kicker {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #9b9b9b;
  margin-bottom: 12px;
}
.chat-welcome h2 {
  font-size: 28px;
  font-weight: 500;
  color: #252525;
  letter-spacing: -0.9px;
  line-height: 1.5;
}
.chat-welcome > p {
  font-size: 12px;
  color: #969696;
  margin-top: 10px;
  line-height: 1.8;
}
.chat-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 34px;
  width: 100%;
  max-width: 570px;
}
.chat-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border: 1px solid #e9e9e9;
  border-radius: 13px;
  background: #fff;
  text-align: left;
  font-size: 11px;
  color: #636363;
  min-width: 0;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}
.chat-prompt .i {
  width: 17px;
  height: 17px;
  color: var(--brand);
}
.chat-message {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin: 22px auto;
  max-width: 760px;
  animation: chat-enter 200ms ease both;
}
.chat-message.from-user {
  justify-content: flex-end;
}
.chat-message-body {
  min-width: 0;
  max-width: 100%;
}
.from-user .chat-message-body {
  max-width: 84%;
}
.chat-message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.95;
  color: #333;
}
.from-user .chat-message-text {
  background: #f3f3f3;
  padding: 12px 19px;
  border-radius: 22px;
}
.from-assistant .chat-message-body {
  flex: 1;
  padding-top: 2px;
}
.chat-avatar {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: none;
  margin-top: 3px;
}
.chat-message-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.chat-message-tools small {
  color: #aaa;
  font-size: 9px;
}
.chat-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  color: #8c8c8c;
  background: transparent;
  font-size: 10px;
}
.chat-tool .i {
  width: 15px;
  height: 15px;
}
.chat-message-tools .chat-tool {
  opacity: 0.55;
}
.chat-message:hover .chat-message-tools .chat-tool {
  opacity: 1;
}
.chat-error .chat-message-text {
  color: #a94444;
  background: #fff8f8;
  padding: 14px;
  border: 1px solid #f5dddd;
  border-radius: 12px;
  font-size: 12px;
}
.chat-thinking {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 36px;
}
.chat-thinking > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
  animation: chat-pulse 1.2s ease-in-out infinite;
}
.chat-thinking > span:nth-child(2) {
  animation-delay: 0.16s;
}
.chat-thinking > span:nth-child(3) {
  animation-delay: 0.32s;
}
.chat-thinking small {
  margin-left: 8px;
  font-size: 10px;
  color: #a1a1a1;
}
.chat-compose-area {
  padding: 16px max(24px, calc((100% - 760px) / 2)) 14px;
  background: #fafafa;
  flex: none;
}
.chat-composer {
  border: 1px solid #e6e6e6;
  border-radius: 25px;
  padding: 16px 18px 12px;
  background: #fff;
  box-shadow: 0 8px 26px -8px #a3e63566, 0 0 18px #a3e6351f;
}
.chat-composer:focus-within {
  border-color: #c7c7d8;
  box-shadow: 0 9px 30px -7px #a3e63580, 0 0 20px #a3e63533;
}
.chat-composer textarea {
  width: 100%;
  display: block;
  padding: 0 2px;
  border: 0;
  background: transparent;
  resize: none;
  color: #333;
  font-size: 13px;
  line-height: 1.8;
  min-height: 30px;
  max-height: 160px;
  outline: none;
  box-shadow: none;
}
.chat-composer textarea:focus-visible {
  outline: none;
}
.chat-composer textarea::placeholder {
  color: #999;
}
.chat-composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.chat-composer-bottom > span {
  color: #aaa;
  font-size: 9px;
  line-height: 1.6;
}
.chat-send {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  flex: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}
.chat-send .i {
  width: 17px;
  height: 17px;
}
.chat-send:disabled {
  background: #ededed;
  color: #aaa;
  opacity: 1;
  cursor: default;
}
.chat-disclaimer {
  color: #a3a3a3;
  text-align: center;
  font-size: 9px;
  line-height: 1.7;
  margin-top: 11px;
}
.chat-connect-hint {
  font-size: 10px;
  color: #8c8c8c;
  text-align: center;
  margin-bottom: 12px;
}
.chat-connect-hint button {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.openai-enabled {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.openai-enabled input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}
@keyframes chat-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes chat-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (hover: hover) and (pointer: fine) {
  .chat-prompt:hover,
  .chat-send:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -6px #a3e63599;
  }
  .chat-history-item:hover,
  .chat-new:hover {
    background: #f0f0f0;
  }
  .chat-tool:hover {
    color: var(--brand);
    background: #f3f3f3;
  }
}
@media (max-width: 1200px) {
  .assistant-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-history {
    display: none;
  }
  .chat-header-new {
    display: inline-flex !important;
  }
  .chat-welcome h2 {
    font-size: 25px;
  }
}
@media (max-width: 700px) {
  .assistant-shell {
    height: calc(100dvh - 152px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 440px;
  }
  .content:has(> .demo) .assistant-shell {
    height: calc(100dvh - 210px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 430px;
  }
  .content:has(.assistant-shell) > .demo {
    margin: 10px 12px 0;
    font-size: 9px;
    padding: 8px 10px;
  }
  .chat-header {
    padding: 16px 18px 10px;
    min-height: 65px;
  }
  .chat-header h1 {
    font-size: 15px;
  }
  .chat-header > div {
    gap: 8px;
  }
  .chat-mode-label select {
    font-size: 9px;
    max-width: 175px;
  }
  .chat-messages {
    padding: 8px 17px;
  }
  .chat-compose-area {
    padding: 12px 14px 10px;
  }
  .chat-welcome {
    padding: 20px 0 25px;
  }
  .chat-welcome h2 {
    font-size: 22px;
    max-width: 290px;
    letter-spacing: -0.6px;
  }
  .chat-welcome > p {
    font-size: 11px;
    max-width: 270px;
  }
  .chat-welcome-kicker {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .chat-welcome > img {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }
  .chat-prompts {
    gap: 8px;
    margin-top: 22px;
  }
  .chat-prompt {
    font-size: 9px;
    padding: 12px 10px;
    gap: 7px;
    border-radius: 11px;
  }
  .chat-prompt .i {
    width: 15px;
    height: 15px;
  }
  .chat-composer {
    padding: 14px;
    border-radius: 22px;
  }
  .chat-composer textarea {
    font-size: 16px;
  }
  .chat-message-text {
    font-size: 12px;
  }
  .chat-avatar {
    width: 25px;
    height: 25px;
  }
  .chat-message {
    gap: 9px;
  }
  .chat-disclaimer {
    font-size: 8px;
  }
  .chat-composer-bottom > span {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-shell * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .chat-prompt:hover,
  .chat-send:hover {
    transform: none;
  }
}

.assistant-shell {
  position: relative;
}
.chat-history-close,
.chat-history-scrim {
  display: none;
}
.chat-header-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 1200px) {
  .history-open .chat-history {
    display: flex;
    position: absolute;
    inset: 0 auto 0 0;
    width: 225px;
    z-index: 36;
    box-shadow: 12px 0 30px #0000000a;
  }
  .history-open .chat-history-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 35;
    border: 0;
    background: #20212326;
  }
  .history-open .chat-history-close {
    display: flex;
    align-self: flex-end;
  }
}

@font-face {
  font-family: Poppins;
  src: url('/assets/poppins-latin-600-normal.woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url('/assets/poppins-latin-ext-600-normal.woff2');
  font-weight: 600;
  unicode-range: U+0100-024F;
  font-display: swap;
}
.chat-message-text strong {
  font-weight: 600;
}

.chat-composer-bottom .chat-send { margin-left: auto; }

/* Compact composer: text and send action share a single row. */
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 22px;
}
.chat-composer textarea {
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 34px;
  padding: 5px 4px;
  line-height: 24px;
  box-sizing: border-box;
}
.chat-composer-bottom {
  flex: none;
  margin: 0;
  height: 34px;
}
@media (max-width: 700px) {
  .chat-composer { padding: 9px 11px; gap: 9px; }
}
