@import url("/assets/fonts/goto-fonts.css");

:root {
  --gc-ink: #081525;
  --gc-muted: #637083;
  --gc-line: rgba(15, 31, 54, .12);
  --gc-panel: rgba(255,255,255,.94);
  --gc-soft: #f4f8fb;
  --gc-primary: #1877f2;
  --gc-green: #22c55e;
  --gc-font: var(--font-goto-sans), Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.gc-inbox {
  width: min(1500px, calc(100vw - 34px));
  margin: 16px auto;
  color: var(--gc-ink);
  font-family: var(--gc-font);
}

.gc-inbox-card {
  min-height: 0;
  height: min(720px, calc(100dvh - 128px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--gc-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(24,119,242,.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(34,197,94,.12), transparent 28%),
    var(--gc-panel);
  box-shadow: 0 20px 70px rgba(15,23,42,.08);
  backdrop-filter: blur(18px);
}

.gc-asset-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gc-line);
  background: rgba(248,251,255,.74);
}

.gc-asset {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid var(--gc-line);
  border-radius: 16px;
  padding: 9px 10px;
  background: #fff;
}

.gc-asset.ok { border-color: rgba(34,197,94,.26); }
.gc-asset.warn { border-color: rgba(245,158,11,.28); }

.gc-asset-icon {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  background: linear-gradient(135deg, #1877f2, #22c55e);
}

.gc-asset strong,
.gc-asset span,
.gc-asset small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-asset strong {
  font-size: 12px;
  font-weight: 760;
}

.gc-asset span,
.gc-asset small {
  color: var(--gc-muted);
  font-size: 11px;
  line-height: 1.28;
}

.gc-asset a {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  color: #1877f2;
  font-size: 11px;
  font-weight: 720;
  text-decoration: none;
}

.gc-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gc-line);
}

.gc-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gc-brand img {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  object-fit: cover;
}

.gc-brand h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -.02em;
}

.gc-brand p {
  margin: 2px 0 0;
  color: var(--gc-muted);
  font-size: 12px;
}

.gc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gc-button {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, #1877f2, #22c55e);
  font: 720 12px/1 var(--gc-font);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.gc-button.ghost {
  color: var(--gc-ink);
  background: #fff;
  border: 1px solid var(--gc-line);
}

.gc-inbox-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 315px minmax(0, 1fr) 330px;
  gap: 0;
}

.gc-thread-list,
.gc-message-panel,
.gc-detail-panel {
  min-height: 0;
  overflow: hidden;
}

.gc-thread-list,
.gc-detail-panel {
  background: rgba(248,251,255,.82);
}

.gc-thread-list {
  border-right: 1px solid var(--gc-line);
}

.gc-detail-panel {
  border-left: 1px solid var(--gc-line);
}

.gc-scroll {
  height: 100%;
  overflow: auto;
  padding: 12px;
}

.gc-thread {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 11px;
  background: transparent;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.gc-thread + .gc-thread { margin-top: 6px; }
.gc-thread.active {
  background: #fff;
  border-color: rgba(24,119,242,.18);
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
}

.gc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, #1877f2, #22c55e);
  overflow: hidden;
}

.gc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-thread strong,
.gc-message strong,
.gc-detail strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 720;
}

.gc-thread span,
.gc-thread small,
.gc-message span,
.gc-detail span {
  color: var(--gc-muted);
  font-size: 12px;
  line-height: 1.38;
}

.gc-thread-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

.gc-channel {
  margin-top: 5px;
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  color: #1d4ed8;
  background: #eaf3ff;
  font-size: 11px;
  font-weight: 760;
}

.gc-message-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(255,255,255,.72);
}

.gc-conversation-head {
  min-height: 72px;
  border-bottom: 1px solid var(--gc-line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gc-conversation-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gc-messages {
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gc-message {
  max-width: 78%;
  border: 1px solid var(--gc-line);
  border-radius: 18px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15,23,42,.05);
}

.gc-message.outbound {
  margin-left: auto;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #1877f2, #18b98a);
}

.gc-message.outbound span { color: rgba(255,255,255,.78); }
.gc-message.error {
  border-color: rgba(232,77,77,.3);
  background: #fff7f7;
}

.gc-reply {
  border-top: 1px solid var(--gc-line);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  background: rgba(248,251,255,.86);
}

.gc-reply textarea {
  width: 100%;
  min-height: 44px;
  max-height: 92px;
  resize: vertical;
  border: 1px solid var(--gc-line);
  border-radius: 14px;
  padding: 11px 12px;
  font: 13px/1.35 var(--gc-font);
  outline: none;
}

.gc-detail {
  display: grid;
  gap: 10px;
}

.gc-detail-row {
  border: 1px solid var(--gc-line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.gc-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--gc-muted);
  text-align: center;
  font-size: 13px;
}

[data-gc-inbox-host] .gc-inbox {
  width: 100%;
  margin: 0;
}

[data-gc-inbox-host] .gc-inbox-card {
  height: min(680px, calc(100dvh - 230px));
  border-radius: 20px;
}

[data-gc-inbox-host] .gc-inbox-grid {
  grid-template-columns: 300px minmax(0, 1fr) 300px;
}

@media (max-width: 980px) {
  .gc-inbox-card { height: auto; min-height: 720px; }
  .gc-asset-strip { grid-template-columns: 1fr; }
  .gc-inbox-grid { grid-template-columns: 1fr; }
  .gc-thread-list,
  .gc-detail-panel {
    border: 0;
    max-height: 260px;
  }
  .gc-message-panel { min-height: 520px; }
}
