.edge-geo-chat-app {
  --edge-geo-rail-width: 284px;
  --edge-geo-border: rgba(15, 23, 42, 0.10);
  --edge-geo-muted: #667085;
  --edge-geo-rail-bg: #f4f6fa;
  --edge-geo-main-bg: #f8f9fc;
}

.edge-geo-chat-app * {
  box-sizing: border-box;
}

.edge-geo-chat-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: clamp(620px, 78vh, 900px);
  min-height: 620px;
  border: 1px solid var(--edge-geo-border);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.edge-geo-chat-rail {
  flex: 0 0 var(--edge-geo-rail-width);
  width: var(--edge-geo-rail-width);
  min-width: 270px;
  max-width: 300px;
  background: var(--edge-geo-rail-bg);
  border-right: 1px solid var(--edge-geo-border);
  display: flex;
  flex-direction: column;
}

.edge-geo-chat-rail-header {
  min-height: 58px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
}

.edge-geo-chat-rail-title-row {
  margin: 0;
  width: 100%;
}

.edge-geo-chat-rail-title {
  font-size: 15px;
  line-height: 1.2;
  color: #18253c;
}

.edge-geo-chat-rail-new-btn {
  height: 28px;
  padding: 0 10px;
}

.edge-geo-chat-rail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.edge-geo-chat-rail-empty {
  font-size: 12px;
  padding: 8px 10px;
}

.edge-geo-chat-sidebar-row {
  border-radius: 10px;
  background: transparent;
  transition: background-color 0.16s ease;
}

.edge-geo-chat-sidebar-row:hover {
  background: rgba(15, 23, 42, 0.05);
}

.edge-geo-chat-sidebar-row.active {
  background: rgba(66, 99, 235, 0.14);
}

.edge-geo-chat-sidebar-row-inner {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.edge-geo-chat-sidebar-select {
  width: 100%;
  text-align: left;
  padding: 8px 9px;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.edge-geo-chat-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.edge-geo-chat-rail .edge-geo-chat-sidebar-title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edge-geo-chat-rail .edge-geo-chat-sidebar-preview {
  font-size: 11px;
  color: var(--edge-geo-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.edge-geo-chat-rail .edge-geo-chat-sidebar-time {
  font-size: 10px;
  color: #98a2b3;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edge-geo-chat-sidebar-delete {
  opacity: 0;
  transition: opacity 0.16s ease, background-color 0.16s ease;
  flex: 0 0 auto;
  margin-top: 6px;
  margin-right: 6px;
  color: #6b7280;
}

.edge-geo-chat-sidebar-row:hover .edge-geo-chat-sidebar-delete,
.edge-geo-chat-sidebar-row.active .edge-geo-chat-sidebar-delete {
  opacity: 0.92;
}

.edge-geo-chat-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--edge-geo-main-bg);
}

.edge-geo-chat-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--edge-geo-border);
}

.edge-geo-chat-main-title {
  font-size: 15px;
  color: #111827;
}

.edge-geo-chat-meta-row {
  padding: 6px 16px 8px;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  gap: 6px;
}

.edge-geo-chat-source-badge {
  color: #475467;
}

.edge-geo-chat-source-badge .iconify {
  width: 11px;
  height: 11px;
}

.edge-geo-chat-transcript-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 10px 0;
}

.edge-geo-chat-transcript {
  height: 100%;
}

#edge-geo-ai-chat-view .mantine-ScrollArea-viewport > div {
  padding: 0 6px 12px;
}

.edge-geo-chat-message-row {
  max-width: 940px;
  margin: 0 auto 8px;
}

.edge-geo-chat-message-row .mantine-Group-root {
  width: 100%;
}

.edge-geo-chat-message-row .mantine-Paper-root {
  max-width: min(860px, 90%) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

.edge-geo-chat-empty {
  max-width: 940px;
  margin: 10px auto 0;
  color: #94a3b8;
  font-size: 13px;
}

.edge-geo-chat-suggestions {
  max-width: 940px;
  margin: 0 auto 10px;
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transition: opacity 0.18s ease, max-height 0.24s ease, margin 0.24s ease;
}

.edge-geo-chat-suggestions.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0 auto;
  pointer-events: none;
}

.edge-geo-chat-suggestion-panel {
  background: rgba(66, 99, 235, 0.08) !important;
  border: 1px solid rgba(66, 99, 235, 0.16) !important;
}

.edge-geo-chat-suggestion-title {
  color: #3f4f99;
}

.edge-geo-chat-suggestion-subtitle {
  color: #6b7280;
}

.edge-geo-chat-suggestion-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.7);
}

.edge-geo-chat-suggestion-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.edge-geo-chat-composer-wrap {
  flex: 0 0 auto;
  padding: 10px 14px 14px;
  background: linear-gradient(180deg, rgba(248, 249, 252, 0) 0%, rgba(248, 249, 252, 1) 35%);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.edge-geo-chat-composer-shell {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px 12px;
}

.edge-geo-chat-composer-row {
  align-items: flex-end;
}

.edge-geo-chat-input {
  flex: 1 1 auto;
  min-width: 0;
}

.edge-geo-chat-send-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: #111827;
}

.edge-geo-chat-send-btn:hover {
  background: #1f2937;
}

@media (max-width: 980px) {
  .edge-geo-chat-layout {
    min-height: 560px;
    height: 74vh;
  }
}
