#section-gpt-chat.crm-section {
  width: 100%;
  align-self: stretch;
  min-width: 0;
}

#section-gpt-chat.crm-section--active {
  min-height: 0;
}

#section-gpt-chat .crm-panel--gpt-chat {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  align-self: stretch;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.gc {
  position: relative;
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(11, 18, 32, 0.82);
  overflow: hidden;
}

.gc-drop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border: 2px dashed #22c55e;
  border-radius: 0;
  background: rgba(4, 20, 10, 0.72);
  color: #bbf7d0;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.gc-drop[hidden] {
  display: none !important;
}

.gc-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 14, 26, 0.55);
}

.gc-new {
  margin: 14px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gc-new:hover {
  background: rgba(34, 197, 94, 0.2);
}

.gc-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gc-conv-empty {
  color: #64748b;
  font-size: 12px;
  text-align: center;
  padding: 20px 8px;
}

.gc-conv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
  cursor: pointer;
}

.gc-conv:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gc-conv--active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #ffffff;
}

.gc-conv--streaming {
  border-color: rgba(74, 222, 128, 0.28);
}

.gc-conv-spinner {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 2px solid rgba(74, 222, 128, 0.28);
  border-top-color: #4ade80;
  border-radius: 50%;
  animation: gc-spin 0.75s linear infinite;
}

@keyframes gc-spin {
  to {
    transform: rotate(360deg);
  }
}

.gc-conv-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gc-conv-owner {
  font-size: 11px;
  font-weight: 700;
  color: #86efac;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-conv-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-conv-del {
  flex-shrink: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 5px;
}

.gc-conv-del:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.gc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 14, 26, 0.6);
}

.gc-bar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gc-bar-title strong {
  color: #ffffff;
  font-size: 15px;
}

.gc-bar-title span {
  color: #86efac;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.gc-model {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.gc-model option {
  background: #0b1220;
  color: #e2e8f0;
}

.gc-bar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-search {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.gc-search--on {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.gc-search:disabled,
.gc-model:disabled,
.gc-attach-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.gc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gc-empty {
  margin: auto;
  text-align: center;
  color: #64748b;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gc-empty strong {
  color: #cbd5e1;
  font-size: 18px;
}

.gc-row {
  display: flex;
  width: 100%;
}

.gc-row--user {
  justify-content: flex-end;
}

.gc-row--asst {
  justify-content: flex-start;
}

.gc-bubble {
  max-width: min(760px, 86%);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.gc-bubble--user {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.32);
  color: #ffffff;
}

.gc-bubble--asst {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6edf6;
}

.gc-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.gc-edit {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
}

.gc-role {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #94a3b8;
}

.gc-code {
  margin: 10px 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  overflow: hidden;
  background: #070d18;
}

.gc-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11px;
  color: #94a3b8;
}

.gc-code-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gc-code-btn {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
}

.gc-code-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.gc-pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre;
}

.gc-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #86efac;
  border-radius: 1px;
  animation: gc-blink 1s steps(2, start) infinite;
}

@keyframes gc-blink {
  to {
    visibility: hidden;
  }
}

.gc-error {
  margin: 0 18px 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
  font-size: 13px;
}

.gc-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 14, 26, 0.6);
}

.gc-textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  font-family: inherit;
}

.gc-textarea:focus {
  outline: none;
  border-color: #86efac;
}

.gc-textarea::placeholder {
  color: #64748b;
}

.gc-send,
.gc-stop {
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}

.gc-send {
  background: #22c55e;
  color: #04140a;
}

.gc-send:hover:not(:disabled) {
  background: #16a34a;
}

.gc-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gc-stop {
  background: #0f172a;
  color: #ffffff;
}

.gc-hint {
  padding: 0 18px 12px;
  color: #64748b;
  font-size: 11.5px;
  background: rgba(7, 14, 26, 0.6);
}

.gc-md {
  word-break: break-word;
}

.gc-md p {
  margin: 0 0 10px;
}

.gc-md p:last-child {
  margin-bottom: 0;
}

.gc-md ul,
.gc-md ol {
  margin: 8px 0;
  padding-left: 22px;
}

.gc-md li {
  margin: 3px 0;
}

.gc-md h1,
.gc-md h2,
.gc-md h3 {
  margin: 14px 0 8px;
  line-height: 1.3;
  color: #ffffff;
}

.gc-md h1 {
  font-size: 20px;
}

.gc-md h2 {
  font-size: 17px;
}

.gc-md h3 {
  font-size: 15px;
}

.gc-md blockquote {
  margin: 8px 0;
  padding: 2px 12px;
  border-left: 3px solid rgba(134, 239, 172, 0.5);
  color: #cbd5e1;
}

.gc-md table {
  border-collapse: collapse;
  margin: 10px 0;
  width: 100%;
  font-size: 13.5px;
}

.gc-md th,
.gc-md td {
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 6px 10px;
  text-align: left;
}

.gc-md th {
  background: rgba(255, 255, 255, 0.05);
}

.gc-inline {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 5px;
  padding: 1px 5px;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.gc-link {
  color: #86efac;
  text-decoration: underline;
}

.gc-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.gc-thumb {
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  object-fit: cover;
}

.gc-attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 4px;
  background: rgba(7, 14, 26, 0.6);
}

.gc-attach-item {
  position: relative;
}

.gc-attach-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  object-fit: cover;
}

.gc-attach-file {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  max-width: 200px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.gc-attach-name,
.gc-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #cbd5e1;
}

.gc-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.gc-file-icon,
.gc-art-icon {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #04140a;
  background: #86efac;
  border-radius: 5px;
  padding: 2px 5px;
}

.gc-status {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.09);
  color: #bbf7d0;
  font-size: 12.5px;
}

.gc-arts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.gc-art {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(420px, 100%);
  padding: 10px;
  border: 1px solid rgba(134, 239, 172, 0.24);
  border-radius: 10px;
  background: rgba(7, 13, 24, 0.55);
}

.gc-art-icon {
  min-width: 42px;
  text-align: center;
  padding: 5px 6px;
}

.gc-art-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.gc-art-info strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-art-info span {
  color: #94a3b8;
  font-size: 11px;
}

.gc-art-dl {
  flex-shrink: 0;
  padding: 6px 9px;
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-size: 11px;
  cursor: pointer;
}

.gc-attach-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: #ef4444;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gc-attach-btn {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="light"] .gc-drop {
  background: rgba(34, 197, 94, 0.12);
  color: #065f46;
}

html[data-theme="light"] .gc {
  background: #ffffff;
}

html[data-theme="light"] .gc-sidebar {
  background: #f8fafc;
  border-right-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .gc-bar,
html[data-theme="light"] .gc-composer,
html[data-theme="light"] .gc-attach-row,
html[data-theme="light"] .gc-hint {
  background: #f8fafc;
}

html[data-theme="light"] .gc-bar {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .gc-bar-title strong,
html[data-theme="light"] .gc-md h1,
html[data-theme="light"] .gc-md h2,
html[data-theme="light"] .gc-md h3,
html[data-theme="light"] .gc-text,
html[data-theme="light"] .gc-md {
  color: #0f172a;
}

html[data-theme="light"] .gc-bar-title span {
  color: #16a34a;
}

html[data-theme="light"] .gc-conv {
  color: #334155;
}

html[data-theme="light"] .gc-conv--active {
  background: rgba(34, 197, 94, 0.14);
  color: #065f46;
  border-color: rgba(34, 197, 94, 0.3);
}

html[data-theme="light"] .gc-conv--streaming {
  border-color: rgba(22, 163, 74, 0.35);
}

html[data-theme="light"] .gc-conv-spinner {
  border-color: rgba(22, 163, 74, 0.22);
  border-top-color: #16a34a;
}

html[data-theme="light"] .gc-conv-owner {
  color: #15803d;
}

html[data-theme="light"] .gc-model,
html[data-theme="light"] .gc-search,
html[data-theme="light"] .gc-textarea,
html[data-theme="light"] .gc-attach-btn {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .gc-model option {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="light"] .gc-search--on {
  background: rgba(34, 197, 94, 0.12);
  color: #065f46;
  border-color: rgba(34, 197, 94, 0.4);
}

html[data-theme="light"] .gc-new {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

html[data-theme="light"] .gc-empty strong {
  color: #334155;
}

html[data-theme="light"] .gc-bubble--asst {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

html[data-theme="light"] .gc-bubble--user {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #0f172a;
}

html[data-theme="light"] .gc-error {
  background: #fef2f2;
  border-color: rgba(185, 27, 27, 0.3);
  color: #b91c1c;
}

html[data-theme="light"] .gc-composer {
  border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .gc-link {
  color: #047857;
}

html[data-theme="light"] .gc-art {
  background: #ffffff;
}

html[data-theme="light"] .gc-art-info strong,
html[data-theme="light"] .gc-attach-name,
html[data-theme="light"] .gc-file-name {
  color: #0f172a;
}

html[data-theme="light"] .gc-art-dl,
html[data-theme="light"] .gc-status {
  color: #166534;
}

@media (max-width: 860px) {
  .gc {
    flex-direction: column;
    height: 100%;
  }

  .gc-sidebar {
    width: 100%;
    max-height: 160px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .gc-conv-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .gc-conv {
    min-width: 160px;
  }
}
