/* Grok Company — public, chat-first shell inspired by x.ai/bot. */
:root {
  --grok-ink: #0a0a0a;
  --grok-muted: #7d8187;
  --grok-muted-2: #a2a4a8;
  --grok-canvas: #ffffff;
  --grok-surface: #f9f8f6;
  --grok-surface-hover: #f3f2f0;
  --grok-line: #e7e7e5;
  --grok-line-strong: #d9d9d6;
  --grok-sans: 'Manrope', 'Helvetica Neue', Helvetica, sans-serif;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background: var(--grok-canvas) !important;
  overflow: hidden !important;
}

#grok-company-app,
#grok-company-app * {
  box-sizing: border-box;
  image-rendering: auto;
}

#grok-company-app {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100svh;
  color: var(--grok-ink);
  background: var(--grok-canvas);
  font-family: var(--grok-sans);
  font-size: 15px;
  line-height: 1.5;
  opacity: 1;
  visibility: visible;
  transition: opacity 240ms ease, visibility 240ms ease;
}

#app {
  position: fixed !important;
  inset: 0;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 240ms ease;
}

/* Legacy connection UI stays outside the public company workspace. */
.reconnecting-overlay {
  display: none !important;
}

.grok-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  flex: 0 0 76px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 clamp(20px, 3vw, 44px);
  border-bottom: 1px solid var(--grok-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.grok-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.grok-brand > img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.grok-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.grok-brand-copy strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.grok-brand-copy span {
  margin-top: 3px;
  color: var(--grok-muted);
  font-size: 11px;
}

.grok-topbar-actions,
.grok-chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grok-twitter-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 13px 0 8px;
  color: var(--grok-ink);
  text-decoration: none;
  border: 1px solid var(--grok-line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 550;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.grok-twitter-button strong {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 7px;
  background: #111;
  font-size: 12px;
  font-weight: 600;
}

.grok-twitter-button:hover {
  border-color: var(--grok-line-strong);
  background: var(--grok-surface);
  transform: translateY(-1px);
}

.grok-live-pill,
.grok-working-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  color: #5e625f;
  border: 1px solid var(--grok-line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.grok-live-dot,
.grok-working-state > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #24b95f;
  box-shadow: 0 0 0 4px rgba(36, 185, 95, 0.11);
  animation: grok-pulse 2.4s ease-in-out infinite;
}

.grok-ghost-button,
.grok-primary-button,
.grok-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  color: var(--grok-ink);
  border: 1px solid var(--grok-line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.grok-ghost-button {
  gap: 8px;
  padding: 0 16px;
}

.grok-button-count {
  color: var(--grok-muted);
}

.grok-primary-button {
  gap: 8px;
  min-width: 116px;
  padding: 0 18px;
  color: #fff;
  border-color: var(--grok-ink);
  background: var(--grok-ink);
}

.grok-primary-button svg,
.grok-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grok-icon-button {
  width: 40px;
  flex: 0 0 40px;
  padding: 0;
}

.grok-ghost-button:hover,
.grok-icon-button:hover {
  border-color: var(--grok-line-strong);
  background: var(--grok-surface);
}

.grok-primary-button:hover {
  background: #272727;
  transform: translateY(-1px);
}

.grok-mobile-menu-button {
  display: none;
}

.grok-workspace {
  display: grid;
  grid-template-columns: 184px 286px minmax(0, 1fr);
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.grok-section-nav {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 20px;
  padding: 20px 12px 14px;
  overflow: hidden;
  border-right: 1px solid var(--grok-line);
  background: #faf9f7;
}

.grok-section-nav-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.grok-section-nav-label {
  display: block;
  padding: 0 9px 7px;
  color: #a0a1a4;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grok-section-nav-button,
.grok-active-project-card button {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 9px;
  color: #74777b;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.grok-section-nav-button:hover,
.grok-section-nav-button.active,
.grok-active-project-card button:hover {
  color: var(--grok-ink);
  border-color: var(--grok-line);
  background: #fff;
}

.grok-section-nav-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.035);
}

.grok-section-nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grok-section-nav-copy,
.grok-active-project-card button > span:last-child,
.grok-section-nav-model > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.grok-section-nav-copy strong,
.grok-active-project-card strong,
.grok-section-nav-model strong {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-section-nav-copy small,
.grok-active-project-card small,
.grok-section-nav-model small {
  overflow: hidden;
  margin-top: 2px;
  color: #a0a1a4;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-active-project-card {
  min-width: 0;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--grok-line);
}

.grok-project-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #25b961;
  box-shadow: 0 0 0 4px rgba(37, 185, 97, 0.1);
}

.grok-section-nav-model {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: auto;
  padding: 11px 9px 4px;
  border-top: 1px solid var(--grok-line);
  color: #56595d;
}

.grok-section-nav-model > span:first-child {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #0b0b0b;
}

.grok-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--grok-line);
  background: #fff;
}

.grok-sidebar > * {
  min-width: 0;
}

.grok-sidebar-search,
.grok-catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: #f4f4f3;
}

.grok-sidebar-search svg,
.grok-catalog-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #9b9da1;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.grok-sidebar-search input,
.grok-catalog-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--grok-ink);
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.grok-sidebar-search input::placeholder,
.grok-catalog-search input::placeholder {
  color: #a5a6a9;
}

.grok-thread-row,
.grok-agent-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  color: var(--grok-ink);
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.grok-thread-row {
  margin-top: 10px;
}

.grok-thread-row:hover,
.grok-agent-row:hover,
.grok-agent-row.active,
.grok-thread-row.active {
  background: #f2f2f1;
}

.grok-thread-avatar,
.grok-agent-avatar,
.grok-chat-avatar,
.grok-message-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

.grok-thread-avatar {
  width: 44px;
  height: 44px;
}

.grok-company-avatar {
  background: var(--grok-ink);
}

.grok-company-avatar img {
  width: 86%;
  height: 86%;
}

.grok-thread-avatar img,
.grok-agent-avatar img,
.grok-chat-avatar img,
.grok-message-avatar img {
  width: 56%;
  height: 56%;
  object-fit: contain;
}

.grok-thread-copy,
.grok-agent-copy {
  min-width: 0;
  flex: 1;
}

.grok-thread-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.grok-thread-title strong,
.grok-agent-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-thread-title time {
  color: var(--grok-muted-2);
  font-size: 10px;
}

.grok-thread-preview,
.grok-agent-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--grok-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 10px 7px;
  color: #999b9f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.grok-sidebar-label button {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #85878a;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.grok-sidebar-label button:hover {
  color: var(--grok-ink);
  background: var(--grok-surface);
}

.grok-agent-list {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1px 14px;
  scrollbar-width: thin;
}

.grok-agent-list::-webkit-scrollbar,
.grok-chat-scroll::-webkit-scrollbar,
.grok-agent-grid::-webkit-scrollbar {
  width: 7px;
}

.grok-agent-list::-webkit-scrollbar-thumb,
.grok-chat-scroll::-webkit-scrollbar-thumb,
.grok-agent-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #d7d7d5;
  background-clip: padding-box;
}

.grok-agent-avatar {
  width: 36px;
  height: 36px;
}

.grok-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin-top: 0;
  padding: 10px 8px 0;
  border-top: 1px solid var(--grok-line);
}

.grok-user-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  color: #777;
  border-radius: 50%;
  background: var(--grok-surface);
  font-size: 11px;
}

.grok-sidebar-footer > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.grok-sidebar-footer strong {
  font-size: 12px;
  font-weight: 550;
}

.grok-sidebar-footer small {
  color: var(--grok-muted);
  font-size: 10px;
}

.grok-chat {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}

.grok-chat-header {
  display: flex;
  min-height: 72px;
  flex: 0 0 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--grok-line);
}

.grok-chat-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.grok-chat-avatar {
  width: 36px;
  height: 36px;
}

.grok-chat-identity > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.grok-chat-identity strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-chat-identity small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--grok-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-chat-scroll {
  min-height: 0;
  max-height: none;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 clamp(18px, 5vw, 82px) 38px;
  scroll-behavior: auto;
  scrollbar-width: thin;
}

.grok-chat-intro {
  display: flex;
  max-width: 780px;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  padding: clamp(42px, 8vh, 84px) 20px 46px;
  text-align: center;
  animation: grok-rise 550ms cubic-bezier(.22,.75,.25,1) both;
}

.grok-chat-intro > img {
  width: 86px;
  height: 86px;
  margin-bottom: 22px;
  object-fit: contain;
}

.grok-chat-intro h1 {
  margin: 0;
  color: var(--grok-ink);
  font-family: var(--grok-sans);
  font-size: clamp(30px, 4.1vw, 50px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-transform: none;
}

.grok-chat-intro p {
  max-width: 580px;
  margin: 17px 0 0;
  color: var(--grok-muted);
  font-size: clamp(14px, 1.45vw, 17px);
  line-height: 1.65;
}

.grok-chat-intro.is-agent-profile {
  display: block;
  width: 100%;
  max-width: 840px;
  padding: 28px 0 26px;
  text-align: left;
}

.grok-agent-profile-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--grok-line);
  border-radius: 16px;
  background: #fff;
}

.grok-agent-profile-card .grok-chat-avatar {
  width: 54px;
  height: 54px;
  margin: 0;
}

.grok-agent-profile-card h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.grok-agent-profile-card p {
  max-width: 680px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.62;
}

.grok-agent-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.grok-agent-profile-meta span {
  padding: 5px 8px;
  color: #777a7e;
  border-radius: 8px;
  background: var(--grok-surface);
  font-size: 10px;
}

.grok-agent-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.grok-agent-context-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--grok-line);
  border-radius: 14px;
  background: #fff;
}

.grok-agent-context-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 13px;
  border-bottom: 1px solid var(--grok-line);
}

.grok-agent-context-panel > header span {
  color: #65686c;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.grok-agent-context-panel > header strong {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: #8d8f92;
  border-radius: 7px;
  background: #f3f2f0;
  font-size: 9px;
  font-weight: 600;
}

.grok-agent-note-list,
.grok-agent-file-list {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: clamp(156px, 22vh, 210px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 9px;
  scrollbar-width: thin;
}

.grok-agent-note {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: #222;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f8f7f5;
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.grok-agent-note > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.grok-agent-note strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-agent-note i {
  padding: 3px 5px;
  color: #8b8d90;
  border-radius: 5px;
  background: #ebeae8;
  font-size: 8px;
  font-style: normal;
}

.grok-agent-note p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: #707378;
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.grok-agent-note small {
  display: block;
  margin-top: 6px;
  color: #a0a2a5;
  font-size: 8px;
}

.grok-agent-note:hover {
  border-color: var(--grok-line-strong);
  background: #fff;
  transform: translateY(-1px);
}

.grok-artifact-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 8px;
  color: #222;
  text-align: left;
  border: 1px solid var(--grok-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.grok-artifact-extension {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 8px;
  background: #171717;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .04em;
}

.grok-artifact-extension[data-kind="table"] { background: #39986a; }
.grok-artifact-extension[data-kind="presentation"] { background: #e17b42; }
.grok-artifact-extension[data-kind="image"] { background: #7b65d8; }
.grok-artifact-extension[data-kind="code"] { background: #315c94; }
.grok-artifact-extension[data-kind="note"] { color: #555; background: #e7e4dd; }

.grok-artifact-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.grok-artifact-copy strong {
  overflow: hidden;
  font-size: 9px;
  font-weight: 620;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-artifact-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: #929498;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-artifact-card > svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #9a9c9f;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grok-artifact-card:hover {
  border-color: #cecfcc;
  background: #faf9f7;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .04);
  transform: translateY(-1px);
}

.grok-message-list {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
}

.grok-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  margin: 0 0 26px;
  transition: opacity 170ms ease;
}

.grok-message.is-new {
  animation: grok-message-in 320ms cubic-bezier(.22,.75,.25,1) both;
}

.grok-message-avatar {
  width: 38px;
  height: 38px;
  margin-top: 2px;
}

.grok-message-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.grok-message-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.grok-message-head strong {
  font-size: 13px;
  font-weight: 600;
}

.grok-message-role,
.grok-message-time {
  color: var(--grok-muted);
  font-size: 10px;
}

.grok-message-time {
  margin-left: auto;
}

.grok-message-text {
  display: inline-block;
  max-width: min(720px, 100%);
  padding: 13px 16px;
  color: #202020;
  border-radius: 6px 18px 18px 18px;
  background: var(--grok-surface);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  transition: transform 170ms ease, background-color 170ms ease, box-shadow 170ms ease;
}

.grok-mention {
  display: inline;
  margin: 0;
  padding: 1px 4px 2px;
  color: #3d59a7;
  border: 0;
  border-radius: 5px;
  background: #e9edfa;
  font: inherit;
  font-size: .94em;
  font-weight: 620;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color 140ms ease, background-color 140ms ease;
}

.grok-mention:hover {
  color: #243c80;
  background: #dce3f8;
}

.grok-message-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  width: min(100%, 540px);
  gap: 7px;
  margin-top: 8px;
}

.grok-message-file {
  background: #fbfaf8;
}

.grok-message.is-right .grok-message-attachments {
  justify-content: end;
}

.grok-message.is-right {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.grok-message.is-right .grok-message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.grok-message.is-right .grok-message-body {
  grid-column: 1;
  grid-row: 1;
  align-items: flex-end;
}

.grok-message.is-right .grok-message-head {
  width: 100%;
  justify-content: flex-end;
}

.grok-message.is-right .grok-message-time {
  order: -1;
  margin: 0 auto 0 0;
}

.grok-message.is-right .grok-message-text {
  border-radius: 18px 6px 18px 18px;
  background: #f1f0ee;
  text-align: left;
}

.grok-message.is-typing .grok-message-text::after {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  content: '';
  background: currentColor;
  animation: grok-caret 620ms steps(1, end) infinite;
}

.grok-message.is-waiting .grok-message-text {
  min-width: 54px;
  min-height: 46px;
}

.grok-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.grok-typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #989a9d;
  animation: grok-dot 980ms ease-in-out infinite;
}

.grok-typing-dots i:nth-child(2) { animation-delay: 120ms; }
.grok-typing-dots i:nth-child(3) { animation-delay: 240ms; }

@media (hover: hover) {
  .grok-message-list:has(.grok-message:hover) .grok-message:not(:hover) { opacity: 0.62; }
  .grok-message:hover .grok-message-text {
    background: #f3f2f0;
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.045);
    transform: translateY(-1px);
  }
  .grok-message:hover .grok-message-avatar { transform: scale(1.035); }
}

.grok-handoff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px auto;
  color: var(--grok-muted);
  font-size: 11px;
  text-align: center;
}

.grok-handoff::before,
.grok-handoff::after {
  width: min(84px, 10vw);
  height: 1px;
  content: '';
  background: var(--grok-line);
}

.grok-card-category i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--agent-color);
}

.grok-empty-chat {
  margin: 0 auto;
  padding: 36px 18px;
  color: var(--grok-muted);
  text-align: center;
}

.grok-composer-wrap {
  flex: 0 0 104px;
  padding: 0 clamp(18px, 5vw, 82px) 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 18px);
}

.grok-composer {
  display: flex;
  width: 100%;
  max-width: 840px;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--grok-line);
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(18, 18, 18, 0.04);
}

.grok-composer-plus {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  color: #95979a;
  border-radius: 50%;
  background: #f5f5f4;
  font-size: 25px;
  font-weight: 300;
}

.grok-composer-placeholder {
  flex: 1;
  color: #adaeb1;
  font-size: 13px;
}

.grok-composer-wave {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 50%;
  background: var(--grok-ink);
}

.grok-composer-wave i {
  width: 2px;
  border-radius: 999px;
  background: #fff;
  animation: grok-wave 1.05s ease-in-out infinite;
}

.grok-composer-wave i:nth-child(1) { height: 7px; animation-delay: -0.25s; }
.grok-composer-wave i:nth-child(2) { height: 14px; animation-delay: -0.1s; }
.grok-composer-wave i:nth-child(3) { height: 11px; animation-delay: -0.4s; }
.grok-composer-wave i:nth-child(4) { height: 6px; animation-delay: -0.2s; }

.grok-composer-wrap > p {
  max-width: 840px;
  margin: 6px auto 0;
  color: #b0b1b4;
  font-size: 10px;
  text-align: center;
}

.grok-catalog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(9px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.grok-catalog-overlay.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.grok-catalog {
  position: relative;
  display: flex;
  width: min(1024px, 100%);
  height: min(760px, 86svh);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(0) scale(1);
  transition: transform 210ms cubic-bezier(.22,.75,.25,1);
}

.grok-catalog-overlay.hidden .grok-catalog {
  transform: translateY(18px) scale(0.985);
}

.grok-catalog-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  color: #8b8d90;
  border: 0;
  border-radius: 50%;
  background: #f4f4f3;
  font-family: inherit;
  font-size: 25px;
  font-weight: 300;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.grok-catalog-close:hover {
  color: var(--grok-ink);
  background: #ececea;
}

.grok-catalog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  padding: 34px 40px 22px;
}

.grok-catalog-header img {
  width: 42px;
  height: 42px;
}

.grok-catalog-header h2 {
  margin: 0;
  color: var(--grok-ink);
  font-family: var(--grok-sans);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-transform: none;
}

.grok-catalog-header p {
  margin: 4px 0 0;
  color: var(--grok-muted);
  font-size: 12px;
}

.grok-catalog-search {
  width: 280px;
  min-height: 48px;
  flex: 0 0 48px;
  margin: 0 0 16px 40px;
}

.grok-catalog-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
  gap: 16px;
  padding: 0 40px 34px;
}

.grok-categories {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  padding-right: 10px;
}

.grok-category-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  color: #85878b;
  border: 0;
  border-radius: 9999px;
  background: #f3f3f2;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.grok-category-button strong {
  color: #a4a5a7;
  font-weight: 500;
}

.grok-category-button.active {
  color: #fff;
  background: var(--grok-ink);
}

.grok-category-button.active strong {
  color: #aeadad;
}

.grok-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 16px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
}

.grok-agent-card {
  min-height: 190px;
  padding: 20px;
  color: var(--grok-ink);
  text-align: left;
  border: 0;
  border-radius: 16px;
  background: var(--grok-surface);
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.grok-agent-card:hover {
  background: var(--grok-surface-hover);
  transform: translateY(-1px);
}

.grok-card-category {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--grok-muted);
  font-size: 10px;
}

.grok-agent-card h3 {
  margin: 10px 0 8px;
  color: var(--grok-ink);
  font-family: var(--grok-sans);
  font-size: 14px;
  font-weight: 540;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-transform: none;
}

.grok-agent-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--grok-muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.grok-no-results {
  grid-column: 1 / -1;
  padding: 64px 20px;
  color: var(--grok-muted);
  text-align: center;
}

.grok-file-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(248, 248, 246, .82);
  backdrop-filter: blur(12px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.grok-file-preview-overlay.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.grok-file-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(900px, 100%);
  height: min(660px, calc(100svh - 56px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--grok-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .14);
  transform: translateY(0) scale(1);
  transition: transform 190ms cubic-bezier(.22,.75,.25,1);
}

.grok-file-preview-overlay.hidden .grok-file-preview {
  transform: translateY(12px) scale(.988);
}

.grok-file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--grok-line);
}

.grok-file-preview-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.grok-file-preview-heading > span:last-child {
  min-width: 0;
}

.grok-file-preview-type {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 10px;
  background: #171717;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
}

.grok-file-preview-type[data-kind="table"] { background: #39986a; }
.grok-file-preview-type[data-kind="presentation"] { background: #e17b42; }
.grok-file-preview-type[data-kind="image"] { background: #7b65d8; }
.grok-file-preview-type[data-kind="code"] { background: #315c94; }
.grok-file-preview-type[data-kind="note"] { color: #555; background: #e7e4dd; }

.grok-file-preview-heading h2 {
  overflow: hidden;
  margin: 0;
  color: #111;
  font-family: var(--grok-sans);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.grok-file-preview-heading p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--grok-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-file-preview-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  color: #888b8f;
  border: 0;
  border-radius: 9px;
  background: #f3f3f1;
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}

.grok-file-preview-close:hover { color: #111; background: #eaeae7; }

.grok-file-preview-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #f7f6f3;
  scrollbar-width: thin;
}

.grok-file-preview-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 21px;
  border-top: 1px solid var(--grok-line);
  background: #fff;
}

.grok-file-preview-footer > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #85888c;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-file-preview-footer i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #28b866;
}

.grok-file-preview-footer button {
  min-width: 72px;
  height: 34px;
  color: #fff;
  border: 0;
  border-radius: 9px;
  background: #111;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.grok-code-preview {
  overflow: hidden;
  border: 1px solid #282d35;
  border-radius: 13px;
  background: #15181d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
}

.grok-code-preview header {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-bottom: 1px solid #292d34;
}

.grok-code-preview header > span { width: 8px; height: 8px; border-radius: 50%; background: #e66a5e; }
.grok-code-preview header > span:nth-child(2) { background: #e5b44e; }
.grok-code-preview header > span:nth-child(3) { background: #5dbd70; }
.grok-code-preview header small { margin-left: 5px; color: #858b95; font-size: 9px; }
.grok-code-preview pre { min-height: 370px; margin: 0; padding: 22px; overflow: auto; color: #d5d9e0; font: 12px/1.75 'JetBrains Mono', monospace; white-space: pre; }

.grok-table-preview {
  overflow: auto;
  border: 1px solid var(--grok-line);
  border-radius: 13px;
  background: #fff;
}

.grok-table-preview table { width: 100%; min-width: 620px; border-collapse: collapse; }
.grok-table-preview th,
.grok-table-preview td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--grok-line); font-size: 11px; }
.grok-table-preview th { position: sticky; top: 0; color: #727579; background: #f1f1ee; font-size: 9px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.grok-table-preview td:nth-child(3) { color: #278858; font-weight: 600; }

.grok-presentation-preview {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--grok-line);
  border-radius: 13px;
  background: #e9e8e4;
}

.grok-presentation-preview aside { display: grid; align-content: start; gap: 9px; padding: 12px; border-right: 1px solid #d9d8d4; }
.grok-presentation-preview aside button { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: center; padding: 5px; color: #929498; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 8px; }
.grok-presentation-preview aside button.active { border-color: #a9a9a5; background: #fff; }
.grok-presentation-preview aside i { display: block; height: 42px; border-radius: 3px; background: linear-gradient(145deg, #171717 55%, #ef9b45 55%); }
.grok-presentation-preview > section { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: center; margin: 28px; padding: clamp(28px, 5vw, 58px); overflow: hidden; color: #fff; border-radius: 6px; background: radial-gradient(circle at 85% 15%, #7b65d8 0, transparent 30%), radial-gradient(circle at 82% 72%, #ef9b45 0, transparent 34%), #121212; }
.grok-slide-kicker { color: #c2c2c0; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.grok-presentation-preview h3 { max-width: 560px; margin: 20px 0 0; color: #fff; font: 500 clamp(30px, 5vw, 55px)/.98 var(--grok-sans); letter-spacing: -.055em; text-transform: none; }
.grok-presentation-preview p { max-width: 490px; margin: 22px 0 0; color: #c8c8c6; font-size: 12px; line-height: 1.6; }
.grok-slide-footer { position: absolute; right: 24px; bottom: 20px; left: 24px; display: flex; justify-content: space-between; color: #bcbcb9; font-size: 8px; }

.grok-image-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--grok-line);
  border-radius: 13px;
  background: #fff;
}
.grok-image-preview-canvas { display: flex; align-items: center; justify-content: center; padding: 30px; background: linear-gradient(45deg,#eee 25%,transparent 25%),linear-gradient(-45deg,#eee 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eee 75%),linear-gradient(-45deg,transparent 75%,#eee 75%),#fff; background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
.grok-image-preview-canvas img { width: min(360px, 82%); height: auto; }
.grok-image-preview > div:last-child { display: flex; flex-direction: column; justify-content: center; padding: 30px; border-left: 1px solid var(--grok-line); }
.grok-image-preview span { color: #999b9f; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.grok-image-preview strong { margin-top: 9px; font-size: 17px; line-height: 1.35; }
.grok-image-preview p { margin: 12px 0 0; color: var(--grok-muted); font-size: 11px; line-height: 1.65; }

.grok-document-preview {
  max-width: 720px;
  min-height: 440px;
  margin: 0 auto;
  padding: 44px clamp(28px, 6vw, 64px);
  border: 1px solid var(--grok-line);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .06);
}
.grok-document-preview h3 { margin: 10px 0 0; color: #111; font: 560 27px/1.2 var(--grok-sans); letter-spacing: -.035em; text-transform: none; }
.grok-document-preview h4 { margin: 28px 0 0; color: #333; font: 650 11px var(--grok-sans); text-transform: uppercase; letter-spacing: .06em; }
.grok-document-preview p,
.grok-document-preview li { color: #5f6266; font-size: 12px; line-height: 1.75; }
.grok-document-preview blockquote { margin: 28px 0 0; padding: 15px 18px; color: #4d5054; border-left: 3px solid #171717; background: #f6f5f2; font-size: 11px; line-height: 1.65; }

.grok-company-window-overlay {
  position: fixed;
  inset: 76px 0 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(11px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.grok-company-window-overlay.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.grok-company-window {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1120px, 100%);
  height: min(760px, calc(100svh - 132px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--grok-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 26px 75px rgba(0, 0, 0, 0.12);
  transform: translateY(0) scale(1);
  transition: transform 200ms cubic-bezier(.22,.75,.25,1);
}

.grok-company-window-overlay.hidden .grok-company-window {
  transform: translateY(14px) scale(0.988);
}

.grok-company-window-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
}

.grok-company-window-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.grok-company-window-title-wrap > span:last-child {
  min-width: 0;
}

.grok-company-window-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f4f3f1;
}

.grok-company-window-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #111;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grok-company-window-title-wrap h2 {
  overflow: hidden;
  margin: 0;
  color: var(--grok-ink);
  font-family: var(--grok-sans);
  font-size: 22px;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.grok-company-window-title-wrap p {
  margin: 4px 0 0;
  color: var(--grok-muted);
  font-size: 11px;
}

.grok-company-window-close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  color: #8d8f92;
  border: 0;
  border-radius: 10px;
  background: #f4f4f3;
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
}

.grok-company-window-close:hover { color: #111; background: #ececea; }

.grok-company-window-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 0 26px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--grok-line);
  scrollbar-width: none;
}

.grok-company-window-tabs::-webkit-scrollbar { display: none; }

.grok-window-tab {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: #85878a;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.grok-window-tab:hover { color: #111; background: #f7f6f4; }
.grok-window-tab.active { color: #111; border-color: var(--grok-line); background: #f4f3f1; }

.grok-company-window-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 26px 30px;
  scrollbar-width: thin;
}

.grok-company-window-content::-webkit-scrollbar { width: 7px; }
.grok-company-window-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #d7d7d5;
  background-clip: padding-box;
}

.grok-window-loading,
.grok-window-empty {
  padding: 72px 20px;
  color: var(--grok-muted);
  text-align: center;
}

.grok-window-loading::after {
  display: inline-block;
  width: 16px;
  overflow: hidden;
  vertical-align: bottom;
  content: '...';
  animation: grok-loading 1.2s steps(4, end) infinite;
}

.grok-live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.grok-live-stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--grok-line);
  border-radius: 13px;
  background: #faf9f7;
}

.grok-live-stat span,
.grok-work-card-kicker,
.grok-doc-kicker {
  display: block;
  color: #999b9f;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.grok-live-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  font-size: 21px;
  font-weight: 560;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-live-stat small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--grok-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-feed-list,
.grok-meeting-list,
.grok-project-list {
  display: grid;
  gap: 9px;
}

.grok-feed-row,
.grok-meeting-row,
.grok-project-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--grok-line);
  border-radius: 12px;
  background: #fff;
  transition: background-color 150ms ease, transform 150ms ease;
}

.grok-feed-row:hover,
.grok-meeting-row:hover,
.grok-project-row:hover { background: #faf9f7; transform: translateY(-1px); }

.grok-feed-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--feed-color, #111);
}

.grok-feed-row strong,
.grok-meeting-row strong,
.grok-project-row strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.grok-feed-row p,
.grok-meeting-row p,
.grok-project-row p {
  margin: 4px 0 0;
  color: #5e6266;
  font-size: 11px;
  line-height: 1.55;
}

.grok-feed-row time,
.grok-meeting-row time,
.grok-project-row time {
  color: #a0a2a5;
  font-size: 9px;
  white-space: nowrap;
}

.grok-project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr);
  gap: 14px;
}

.grok-work-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--grok-line);
  border-radius: 14px;
  background: #fff;
}

.grok-work-card h3 {
  margin: 8px 0 0;
  color: #111;
  font-family: var(--grok-sans);
  font-size: 20px;
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-transform: none;
}

.grok-work-card p {
  margin: 9px 0 0;
  color: var(--grok-muted);
  font-size: 11px;
  line-height: 1.62;
}

.grok-progress-track {
  height: 6px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 3px;
  background: #ececea;
}

.grok-progress-track span { display: block; width: var(--progress, 64%); height: 100%; background: #111; }

.grok-project-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.grok-project-metric { padding: 12px; border-radius: 10px; background: #f7f6f4; }
.grok-project-metric strong { display: block; font-size: 16px; font-weight: 560; }
.grok-project-metric small { color: var(--grok-muted); font-size: 9px; }

.grok-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  min-width: 900px;
}

.grok-kanban-scroll { overflow-x: auto; padding-bottom: 6px; }
.grok-kanban-column { min-width: 0; padding: 12px; border-radius: 13px; background: #f7f6f4; }
.grok-kanban-column-header { display: flex; justify-content: space-between; margin-bottom: 10px; color: #5f6266; font-size: 10px; font-weight: 650; }
.grok-kanban-column-header span { color: #a0a2a5; }
.grok-kanban-cards { display: grid; gap: 8px; max-height: 390px; overflow-y: auto; }
.grok-kanban-card { width: 100%; padding: 12px; color: #111; text-align: left; border: 1px solid var(--grok-line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.grok-kanban-card:hover { border-color: #c7c7c3; box-shadow: 0 8px 20px rgba(17, 17, 17, .06); transform: translateY(-1px); }
.grok-kanban-card strong { display: block; font-size: 11px; font-weight: 580; line-height: 1.45; }
.grok-kanban-card span { display: block; margin-top: 8px; color: var(--grok-muted); font-size: 9px; }

.grok-roadmap { display: grid; gap: 11px; }
.grok-roadmap-row { display: grid; width: 100%; grid-template-columns: 94px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 10px; color: #111; text-align: left; border: 0; border-bottom: 1px solid var(--grok-line); border-radius: 10px; background: transparent; font: inherit; cursor: pointer; transition: background-color 150ms ease; }
.grok-roadmap-row:hover { background: #f7f6f4; }
.grok-roadmap-row:last-child { border-bottom: 0; }
.grok-roadmap-row > span:first-child { color: #8c8e91; font-size: 10px; }
.grok-roadmap-row strong { font-size: 12px; font-weight: 600; }
.grok-roadmap-row p { margin: 3px 0 0; color: var(--grok-muted); font-size: 10px; }
.grok-roadmap-state { padding: 5px 8px; border-radius: 8px; background: #f2f2f0; color: #676a6e; font-size: 9px; }

.grok-file-grid,
.grok-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grok-file-card,
.grok-doc-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--grok-line);
  border-radius: 13px;
  background: #fff;
}

.grok-project-file { min-height: 68px; }

.grok-file-card strong,
.grok-doc-card h3 { display: block; overflow: hidden; margin: 7px 0 0; color: #111; font-family: var(--grok-sans); font-size: 13px; font-weight: 600; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.grok-file-card small { display: block; margin-top: 5px; color: var(--grok-muted); font-size: 9px; }
.grok-doc-card p { margin: 8px 0 0; color: var(--grok-muted); font-size: 11px; line-height: 1.62; }

.grok-doc-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.grok-doc-step { position: relative; padding: 14px; border-radius: 11px; background: #f7f6f4; }
.grok-doc-step span { display: block; color: #a0a2a5; font-size: 9px; }
.grok-doc-step strong { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; }

@keyframes grok-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.86); }
}

@keyframes grok-wave {
  0%, 100% { transform: scaleY(0.6); opacity: 0.65; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

@keyframes grok-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes grok-message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes grok-caret {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes grok-dot {
  0%, 70%, 100% { opacity: .36; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

@keyframes grok-loading {
  from { width: 0; }
  to { width: 16px; }
}

@media (max-width: 1100px) {
  .grok-workspace { grid-template-columns: 68px 264px minmax(0, 1fr); }
  .grok-section-nav { padding-inline: 8px; }
  .grok-section-nav-label,
  .grok-section-nav-copy,
  .grok-active-project-card button > span:last-child,
  .grok-section-nav-model > span:last-child { display: none; }
  .grok-section-nav-button,
  .grok-active-project-card button { justify-content: center; padding-inline: 6px; }
  .grok-active-project-card { padding-top: 10px; }
  .grok-active-project-card button { min-height: 42px; }
  .grok-section-nav-model { justify-content: center; }
}

@media (max-width: 900px) {
  .grok-workspace { grid-template-columns: 64px 250px minmax(0, 1fr); }
  .grok-sidebar { padding-inline: 10px; }
  .grok-chat-scroll { padding-inline: 28px; }
  .grok-composer-wrap { padding-inline: 28px; }
  .grok-catalog-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .grok-catalog-search { width: 220px; }
  .grok-agent-grid { grid-template-columns: 1fr; }
  .grok-live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grok-live-stat:last-child { grid-column: 1 / -1; }
  .grok-project-layout { grid-template-columns: 1fr; }
  .grok-doc-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grok-file-preview { height: min(700px, calc(100svh - 40px)); }
}

@media (max-width: 680px) {
  .grok-topbar {
    flex-basis: 66px;
    padding: 0 14px;
  }
  .grok-brand > img { width: 40px; height: 40px; }
  .grok-brand-copy span { display: none; }
  .grok-brand-copy strong { font-size: 14px; }
  .grok-twitter-button { width: 40px; padding: 0 6px; justify-content: center; }
  .grok-twitter-button span { display: none; }
  .grok-ghost-button,
  .grok-primary-button { display: none; }
  .grok-mobile-menu-button { display: inline-flex; }
  .grok-workspace { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); }
  .grok-section-nav {
    grid-column: 1;
    padding: 12px 7px 10px;
  }
  .grok-section-nav-group { gap: 4px; }
  .grok-section-nav-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .grok-active-project-card { margin-top: 0; }
  .grok-section-nav-model { padding-inline: 0; }
  .grok-sidebar {
    position: absolute;
    inset: 0 auto 0 56px;
    z-index: 8;
    width: min(calc(100vw - 56px), 314px);
    border-right: 1px solid var(--grok-line);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.09);
    transform: translateX(calc(-100% - 58px));
    transition: transform 220ms cubic-bezier(.22,.75,.25,1);
  }
  #grok-company-app.sidebar-open .grok-sidebar { transform: translateX(0); }
  .grok-chat { grid-column: 2; height: 100%; }
  .grok-chat-header { min-height: 64px; flex-basis: 64px; padding: 0 14px; }
  .grok-working-state { display: none; }
  .grok-chat-scroll {
    max-height: none;
    padding-inline: 16px;
    padding-bottom: 24px;
  }
  .grok-chat-intro { padding: 42px 8px 36px; }
  .grok-chat-intro.is-agent-profile { padding: 18px 0; }
  .grok-agent-profile-card { grid-template-columns: 44px minmax(0, 1fr); gap: 13px; padding: 16px; }
  .grok-agent-profile-card .grok-chat-avatar { width: 44px; height: 44px; }
  .grok-agent-profile-card h1 { font-size: 22px; }
  .grok-agent-context-grid { grid-template-columns: 1fr; }
  .grok-agent-note-list,
  .grok-agent-file-list { max-height: 174px; }
  .grok-message { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .grok-message.is-right { grid-template-columns: minmax(0, 1fr) 34px; }
  .grok-message-avatar { width: 34px; height: 34px; }
  .grok-message-text { font-size: 13px; }
  .grok-message-attachments { grid-template-columns: 1fr; width: min(100%, 310px); }
  .grok-composer-wrap { flex-basis: 96px; padding-inline: 12px; }
  .grok-composer { min-height: 54px; }
  .grok-composer-plus,
  .grok-composer-wave { width: 38px; height: 38px; flex-basis: 38px; }
  .grok-catalog-overlay { align-items: flex-end; padding: 0; }
  .grok-catalog { width: 100%; height: 92svh; border-radius: 24px 24px 0 0; }
  .grok-catalog-header { padding: 30px 24px 18px; }
  .grok-catalog-header h2 { font-size: 24px; }
  .grok-catalog-close { top: 18px; right: 18px; }
  .grok-catalog-search { width: auto; margin: 0 24px 14px; }
  .grok-catalog-layout { display: flex; flex-direction: column; gap: 14px; padding: 0 24px 24px; }
  .grok-categories { flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 3px; scrollbar-width: none; }
  .grok-categories::-webkit-scrollbar { display: none; }
  .grok-category-button { flex: 0 0 auto; }
  .grok-agent-grid { flex: 1; grid-template-columns: 1fr; }
  .grok-agent-card { min-height: 176px; }
  .grok-file-preview-overlay { align-items: flex-end; padding: 0; }
  .grok-file-preview { width: 100%; height: 94svh; border-radius: 18px 18px 0 0; }
  .grok-file-preview-header { padding: 16px; }
  .grok-file-preview-body { padding: 14px; }
  .grok-file-preview-footer { padding: 0 16px; }
  .grok-presentation-preview { grid-template-columns: 1fr; min-height: 500px; }
  .grok-presentation-preview aside { display: none; }
  .grok-presentation-preview > section { margin: 12px; padding: 26px; }
  .grok-image-preview { grid-template-columns: 1fr; }
  .grok-image-preview > div:last-child { border-top: 1px solid var(--grok-line); border-left: 0; }
  .grok-document-preview { padding: 28px 22px; }
  .grok-company-window-overlay { inset: 66px 0 0; align-items: flex-end; padding: 0 0 0 56px; }
  .grok-company-window { width: 100%; height: 94%; border-radius: 18px 18px 0 0; }
  .grok-company-window-header { padding: 18px 18px 14px; }
  .grok-company-window-tabs { padding-inline: 18px; }
  .grok-company-window-content { padding: 18px; }
  .grok-live-stats { grid-template-columns: 1fr; }
  .grok-live-stat:last-child { grid-column: auto; }
  .grok-file-grid,
  .grok-doc-grid { grid-template-columns: 1fr; }
  .grok-doc-flow { grid-template-columns: 1fr 1fr; }
  .grok-feed-row,
  .grok-meeting-row,
  .grok-project-row { grid-template-columns: auto minmax(0, 1fr); }
  .grok-feed-row time,
  .grok-meeting-row time,
  .grok-project-row time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #grok-company-app *,
  #app {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* real artifact viewer frame (backend-served files) */
.grok-real-frame { width: 100%; height: min(68vh, 780px); border: 0; border-radius: 12px; background: #fff; }
