.gb-setup { --gb-annotation: #d62938; }
[data-theme="dark"] .gb-setup { --gb-annotation: #ff6874; }
.gb-setup > .imsg-container { position: relative; }

.gb-setup-heading {
  display: flex;
  align-items: center;
  gap: 12px 20px;
}

.gb-setup-window {
  --gb-app-ink: #202020;
  --gb-app-muted: #626262;
  --gb-app-border: #dedede;
  --gb-app-sidebar: #f2f2f2;
  --gb-app-canvas: #fafafa;
  --gb-app-surface: #fff;
  --gb-app-selected: #e3e3e3;
  --gb-app-message: #f0f0f0;
  --gb-app-user: #e9e9eb;
  --gb-app-shadow: 0 16px 45px rgba(31, 39, 53, .12), 0 2px 8px rgba(31, 39, 53, .06);
  display: grid;
  grid-template-columns: 35.7% minmax(0, 1fr);
  width: min(100%, 976px);
  min-height: 510px;
  margin-top: 24px;
  border: 1px solid var(--gb-app-border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--gb-app-canvas);
  color: var(--gb-app-ink);
  box-shadow: var(--gb-app-shadow);
  font: 400 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  letter-spacing: normal;
}

[data-theme="dark"] .gb-setup-window {
  --gb-app-ink: #f1f1f1;
  --gb-app-muted: #b0b0b0;
  --gb-app-border: #383838;
  --gb-app-sidebar: #232323;
  --gb-app-canvas: #1c1c1c;
  --gb-app-surface: #2a2a2a;
  --gb-app-selected: #343434;
  --gb-app-message: #292929;
  --gb-app-user: #343438;
  --gb-app-shadow: 0 16px 45px rgba(0, 0, 0, .22);
}

.gb-setup-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 17px;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--gb-app-border);
  background: var(--gb-app-sidebar);
}

.gb-setup-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 9px;
  padding-inline: 3px;
}

.gb-setup-traffic {
  display: flex;
  gap: 9px;
  margin-top: 4px;
}

.gb-setup-traffic i {
  display: block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
  background: #fc605c;
}

.gb-setup-traffic i:nth-child(2) { background: #fcbe32; }
.gb-setup-traffic i:nth-child(3) { background: #31c64b; }

.gb-setup-tools, .gb-setup-sidebar-footer {
  display: flex;
  gap: 9px;
  align-items: center;
}

.gb-setup-tool, .gb-setup-compose-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gb-app-border);
  border-radius: 50%;
  background: var(--gb-app-surface);
}

.gb-setup-window svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gb-setup-conversations {
  display: grid;
  gap: 4px;
  margin: 0 0 auto;
  padding: 0;
  list-style: none;
}

.gb-setup-conversations li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 14px;
}

.gb-setup-selected { background: var(--gb-app-selected); }

.gb-setup-avatar {
  position: relative;
  display: block;
  flex: none;
  width: 36px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gb-bot-fill);
  box-shadow: inset 0 0 0 1px var(--gb-bot-rim-dark);
}

.gb-setup-avatar::before, .gb-setup-avatar::after {
  position: absolute;
  top: 25%;
  left: 43%;
  width: 15%;
  height: 29%;
  border-radius: 999px;
  background: var(--gb-setup-eye, var(--gb-bot-eye));
  transform: rotate(-32deg);
  content: "";
}

.gb-setup-avatar::after {
  top: 17%;
  left: 66%;
  width: 10%;
  height: 25%;
  border-radius: 56% 44% 44% 56%;
}

.gb-setup-avatar:is(.gb-setup-mint, .gb-setup-orange, .gb-setup-lavender, .gb-setup-blue) {
  --gb-setup-eye: #fff;
  box-shadow: none;
}

.gb-setup-mint { border-radius: 42%; background: #13b7a6; }
.gb-setup-orange { background: #fc6814; }
.gb-setup-lavender { background: #8c63ee; }
.gb-setup-blue { border-radius: 38%; background: #2188fa; }

.gb-setup-conversations b, .gb-setup-conversations small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-setup-conversations b { font-size: 15px; font-weight: 550; }
.gb-setup-conversations small { margin-top: 2px; color: var(--gb-app-muted); font-size: 13px; }

.gb-setup-connect {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--gb-app-border);
  border-radius: 999px;
  background: var(--gb-app-surface);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-setup-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 18px 16px;
}

.gb-setup-header {
  position: relative;
  display: flex;
  justify-content: center;
}

.gb-setup-app-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 9px;
  border: 1px solid var(--gb-app-border);
  border-radius: 999px;
  background: var(--gb-app-surface);
  box-shadow: 0 4px 14px rgba(25, 25, 25, .07);
  font-weight: 550;
}

.gb-setup-app-title .gb-setup-avatar { width: 25px; }

.gb-setup-share {
  position: absolute;
  right: 0;
  top: 1px;
}

.gb-setup-messages {
  display: grid;
  gap: 19px;
  align-content: center;
  flex: 1 0 auto;
  padding-block: 37px 20px;
}

.gb-setup-paste, .gb-setup-response {
  max-width: min(100%, 500px);
  padding: 13px 15px;
  border: 1px solid var(--gb-app-border);
  border-radius: 20px;
}

.gb-setup-paste {
  position: relative;
  justify-self: end;
  background: var(--gb-app-user);
}

.gb-setup-paste::after {
  position: absolute;
  inset: -5px -6px -6px -7px;
  border: 2px solid var(--gb-annotation);
  border-radius: 36px 31px 35px 32px / 25px 32px 29px 34px;
  transform: rotate(-.5deg);
  pointer-events: none;
  content: "";
}

.gb-setup-arrow {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--gb-annotation);
  stroke-width: clamp(3.5px, .36vw, 5px);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.gb-setup-paste pre, .gb-setup-paste code {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gb-setup-copy {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1.2 var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.gb-setup-copy[hidden] { display: none; }
.gb-setup-copy:hover { background: var(--surface-2); }
.gb-setup-copy:focus-visible { outline: 2px solid var(--gb-accent); outline-offset: 3px; }
.gb-setup-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.gb-setup-response {
  justify-self: start;
  background: var(--gb-app-message);
}

.gb-setup-compose {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 5px 8px;
  border: 1px solid var(--gb-app-border);
  border-radius: 999px;
  background: var(--gb-app-surface);
  box-shadow: 0 3px 12px rgba(25, 25, 25, .06);
}

.gb-setup-compose-icon {
  width: 31px;
  height: 31px;
  background: var(--gb-app-message);
  color: var(--gb-app-muted);
}

.gb-setup-placeholder {
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--gb-app-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-setup-voice {
  border-color: #202020;
  background: #202020;
  color: #fff;
}

@media (max-width: 700px) {
  .gb-setup-window { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 20px; }
  .gb-setup-sidebar { display: none; }
  .gb-setup-chat { padding-inline: 12px; }
}

@media (max-width: 390px) {
  .grok-page .gb-setup-heading h2 { font-size: clamp(26px, 8vw, 32px); }
  .gb-setup-heading { gap: 10px; }
  .gb-setup-window { font-size: 14px; }
  .gb-setup-response, .gb-setup-paste { padding-inline: 11px; }
  .gb-setup-share, .gb-setup-mic { display: none; }
}
