.athena-chat-widget {
  border: 1px solid #dde3ec;
  border-radius: 12px;
  background: #f8fafd;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

.athena-chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid #e4e9f0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f3f6fb;
}

.athena-chat-header-title {
  font-weight: 600;
  color: #1e293b;
}

.athena-chat-sidebar-toggle {
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  padding: 0;
  width: 34px;
  height: 30px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.athena-chat-icon {
  display: inline-flex;
  width: 1em;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.athena-chat-icon-sidebar {
  font-size: 13px;
  color: #64748b;
}

.athena-chat-body {
  display: flex;
  min-height: 620px;
}

.athena-chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.athena-chat-history {
  width: 320px;
  border-right: 1px solid #e4e9f0;
  padding: 12px;
  background: #f3f6fb;
  display: flex;
  flex-direction: column;
  transition: width 0.18s ease, padding 0.18s ease;
  overflow: hidden;
}

.athena-chat-sidebar-collapsed .athena-chat-history {
  width: 0;
  padding: 0;
  border-right: 0;
}

.athena-chat-messages {
  min-height: 420px;
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafd;
}

.athena-chat-message {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.athena-chat-message-user {
  margin-left: 18%;
  background: #2f5ef6;
  color: #ffffff;
  border-top-right-radius: 8px;
}

.athena-chat-message-assistant {
  margin-right: 14%;
  background: #eef2f8;
  color: #0f172a;
  white-space: normal;
  border-top-left-radius: 8px;
  border: 1px solid #e2e8f0;
}

.athena-chat-markdown {
  color: #142033;
  font-size: 1.6rem;
  line-height: 1.65;
}

.athena-chat-markdown h1,
.athena-chat-markdown h2,
.athena-chat-markdown h3,
.athena-chat-markdown h4,
.athena-chat-markdown h5,
.athena-chat-markdown h6 {
  color: #081224;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

.athena-chat-markdown h1 {
  font-size: 2.6rem;
}

.athena-chat-markdown h2 {
  font-size: 2.2rem;
}

.athena-chat-markdown h3 {
  font-size: 1.95rem;
}

.athena-chat-markdown h4,
.athena-chat-markdown h5,
.athena-chat-markdown h6 {
  font-size: 1.65rem;
}

.athena-chat-markdown p,
.athena-chat-markdown li {
  font-size: 1.6rem;
}

.athena-chat-markdown p {
  margin: 0 0 0.75em;
}

.athena-chat-markdown p:last-child {
  margin-bottom: 0;
}

.athena-chat-markdown ul,
.athena-chat-markdown ol {
  margin: 0 0 0.75em 1.2em;
  padding-left: 0;
}

.athena-chat-markdown li {
  margin: 0.2em 0;
}

.athena-chat-markdown a {
  color: #2563eb;
  text-decoration: none;
}

.athena-chat-markdown a:hover,
.athena-chat-markdown a:focus {
  color: #1d4ed8;
  text-decoration: none;
}

.athena-chat-markdown pre,
.athena-chat-markdown code {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace !important;
}

.athena-chat-markdown pre {
  background: #0f172a;
  border: 1px solid #0b1222;
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 1.35rem;
  margin: 0 0 0.85em;
  overflow-x: auto;
  padding: 16px;
}

.athena-chat-markdown :not(pre) > code {
  background: #e6eef9;
  border-radius: 5px;
  color: #0b2b67;
  font-size: 0.95em;
  padding: 2px 5px;
}

.athena-chat-markdown blockquote {
  border-left: 3px solid #cbd8ea;
  color: #4f6077;
  margin: 0 0 0.85em;
  padding: 0 0 0 12px;
}

.athena-chat-markdown table {
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0 0 0.85em;
  width: 100%;
}

.athena-chat-markdown th,
.athena-chat-markdown td {
  border: 1px solid #d7e1ef;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.athena-chat-markdown th {
  background: #f0f5fd;
  font-weight: 600;
}

.athena-chat-markdown td a,
.athena-chat-markdown th a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.athena-chat-message-pending {
  color: #475569;
  font-style: italic;
}

.athena-chat-message-pending::after {
  content: '';
  display: inline-block;
  width: 1.25em;
  text-align: left;
  animation: athena-chat-ellipsis 1.2s steps(4, end) infinite;
}

.athena-chat-form {
  padding: 12px 14px 14px;
  border-top: 1px solid #e4e9f0;
  background: #f3f6fb;
}

.athena-chat-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #d4dce8;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.4;
  font-family: inherit;
  background: #ffffff;
}

.athena-chat-controls {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.athena-chat-send {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: #2f5ef6;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.athena-chat-send:disabled {
  opacity: 0.55;
  cursor: default;
}

.athena-chat-error {
  color: #b91c1c;
  font-size: 13px;
  padding: 0 14px 12px;
}

.athena-chat-history-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.athena-chat-history-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.athena-chat-history-new {
  border: 1px solid #d2d9e5;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.athena-chat-history-new:hover {
  background: #eef2f8;
}

.athena-chat-icon-new-chat {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.athena-chat-session-state {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.athena-chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 430px;
}

.athena-chat-history-item {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  padding: 9px 12px;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.athena-chat-history-item.is-selected {
  border-color: #b7caef;
  background: #dbe7ff;
  color: #19439a;
}

.athena-chat-icon-session {
  font-size: 8px;
  color: #94a3b8;
}

.athena-chat-history-item.is-selected .athena-chat-icon-session {
  color: #2563eb;
}

.athena-chat-history-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athena-chat-history-empty {
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 900px) {
  .athena-chat-body {
    flex-direction: column;
    min-height: 0;
  }

  .athena-chat-history {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #e4e9f0;
  }

  .athena-chat-sidebar-collapsed .athena-chat-history {
    width: 100%;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .athena-chat-messages {
    min-height: 280px;
    padding: 12px;
  }
}

@keyframes athena-chat-ellipsis {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75%, 100% {
    content: '...';
  }
}
