/* Graphite AI Assistant - dedicated product guidance workspace */
.gn-assistant-page {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: calc(100vh - 48px);
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .05);
}

.gn-assistant-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #e6ebf2;
  background: #f8fafc;
}

.gn-assistant-sidebar__header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #e6ebf2;
}

.gn-assistant-sidebar__header > div:first-child {
  margin-bottom: 14px;
}

.gn-assistant-eyebrow {
  margin-bottom: 3px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.gn-assistant-sidebar h1 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 750;
}

.gn-assistant-new {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.gn-assistant-new:hover { border-color: #94a3b8; background: #f8fafc; }

.gn-assistant-conversation-list {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
}

.gn-assistant-conversation {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.gn-assistant-conversation:hover { background: #fff; border-color: #e2e8f0; }
.gn-assistant-conversation.is-active { background: #eef4ff; border-color: #cfe0ff; box-shadow: inset 3px 0 0 #195cff; }

.gn-assistant-conversation__title {
  display: block;
  overflow: hidden;
  color: #172033;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gn-assistant-conversation__time {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 14px;
}

.gn-assistant-list-state {
  padding: 14px 10px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}
.gn-assistant-list-state--center { text-align: center; }

.gn-assistant-chat {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  min-height: 0;
  background: #fff;
}

.gn-assistant-chat__header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border-bottom: 1px solid #e6ebf2;
  background: #fff;
}

.gn-assistant-chat__identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gn-assistant-chat__identity h2 { margin: 0 0 2px; font-size: 14px; font-weight: 750; color: #0f172a; }
.gn-assistant-chat__identity p { margin: 0; color: #64748b; font-size: 14px; }

.gn-assistant-spark,
.gn-assistant-empty__icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e8f4ff;
  color: #087cf0;
  font-size: 15px;
  flex: 0 0 auto;
}

.gn-assistant-scope-badge {
  padding: 5px 8px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f0f7ff;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.gn-assistant-messages {
  min-height: 0;
  padding: 22px max(22px, 8%);
  overflow-y: auto;
  background: #fbfcfe;
}

.gn-assistant-empty {
  max-width: 650px;
  margin: 8vh auto 0;
  text-align: center;
}

.gn-assistant-empty__icon { margin-bottom: 12px; }
.gn-assistant-empty h3 { margin: 0 0 7px; color: #0f172a; font-size: 18px; font-weight: 750; }
.gn-assistant-empty p { max-width: 590px; margin: 0 auto; color: #64748b; font-size: 14px; line-height: 1.6; }

.gn-assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.gn-assistant-suggestions button {
  padding: 7px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  cursor: pointer;
}
.gn-assistant-suggestions button:hover { border-color: #b8c8df; background: #f8fafc; }

.gn-assistant-message-row { display: flex; width: 100%; margin-bottom: 16px; }
.gn-assistant-message-row.is-user { justify-content: flex-end; }
.gn-assistant-message-row.is-assistant { justify-content: flex-start; }

.gn-assistant-message {
  max-width: min(760px, 84%);
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .025);
}

.is-user .gn-assistant-message {
  border-color: #246bfe;
  background: #246bfe;
  color: #fff;
  box-shadow: 0 6px 16px rgba(36, 107, 254, .18);
}

.is-user .gn-assistant-message__role {
  color: rgba(255, 255, 255, .78);
}

.is-user .gn-assistant-message__content,
.is-user .gn-assistant-message__content * {
  color: #fff;
}

.is-user .gn-assistant-message__content a {
  text-decoration: underline;
}

.gn-assistant-message__role {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 14px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.gn-assistant-message__content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.6;
}

.gn-assistant-message__content--markdown { white-space: normal; }
.gn-assistant-message__content--markdown p:last-child { margin-bottom: 0; }
.gn-assistant-message__content--markdown ul,
.gn-assistant-message__content--markdown ol { padding-left: 20px; }

.gn-assistant-thinking { display: inline-flex; gap: 4px; padding: 3px 0; }
.gn-assistant-thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  animation: gnAssistantThinking 1.1s infinite ease-in-out;
}
.gn-assistant-thinking span:nth-child(2) { animation-delay: .15s; }
.gn-assistant-thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes gnAssistantThinking { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gn-assistant-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 18px 0;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff7f7;
  color: #b42318;
  font-size: 14px;
}
.gn-assistant-error button { border: 0; background: transparent; color: #b42318; font-weight: 750; cursor: pointer; }

.gn-assistant-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  margin: 12px 18px 6px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .05);
}

.gn-assistant-composer:focus-within { border-color: #8bb5ff; box-shadow: 0 0 0 3px rgba(25, 92, 255, .08); }

.gn-assistant-composer textarea {
  width: 100%;
  min-height: 32px;
  max-height: 130px;
  resize: vertical;
  padding: 7px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.gn-assistant-composer button {
  width: 34px;
  height: 34px;
  align-self: end;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(90deg, #195cff, #087cf0);
  color: #fff;
  cursor: pointer;
}
.gn-assistant-composer button:disabled { opacity: .45; cursor: default; }

.gn-assistant-disclaimer {
  padding: 0 18px 12px;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}

/* Make the existing Home assistant surface a real input without changing its brand treatment. */
.gnb-ai-assistant .gn-ai-prompt--input input {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172033;
  font-family: inherit;
  font-size: 14px;
}
.gnb-ai-assistant .gn-ai-prompt--input input::placeholder { color: #94a3b8; }
.gnb-ai-assistant .gn-ai-prompt--input button { width: auto; }

@media (max-width: 1050px) {
  .gn-assistant-page { grid-template-columns: 220px minmax(0, 1fr); }
  .gn-assistant-messages { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 760px) {
  .gn-assistant-page { display: block; min-height: auto; }
  .gn-assistant-sidebar { max-height: 220px; border-right: 0; border-bottom: 1px solid #e6ebf2; }
  .gn-assistant-conversation-list { max-height: 150px; }
  .gn-assistant-chat { min-height: 65vh; }
  .gn-assistant-scope-badge { display: none; }
  .gn-assistant-message { max-width: 94%; }
}
