body {
  background:
    radial-gradient(circle at top left, rgba(242, 202, 80, 0.05), transparent 24%),
    radial-gradient(circle at right 15%, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(180deg, #131313 0%, #101010 100%);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 24;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-grid {
  align-items: stretch;
}

.panel-height {
  height: min(760px, calc(100vh - 182px));
}

.context-panel,
.chat-shell {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

.context-panel {
  overflow: hidden;
}

.context-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1.5rem;
}

.context-top {
  display: grid;
  gap: 1.75rem;
}

.route-card {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.route-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  color: rgba(185, 178, 165, 0.55);
}

.meta-label {
  font-family: "Manrope", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b9b2a5;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.9rem;
}

.detail-item {
  min-width: 0;
}

.detail-value {
  margin-top: 0.5rem;
  color: #ece8df;
  font-size: 1.12rem;
  line-height: 1.5;
}

.status-value {
  color: #f2ca50;
}

.scope-note {
  display: flex;
  gap: 0.85rem;
  margin-top: auto;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.015);
  color: #c8c2b6;
  line-height: 1.55;
  font-size: 0.94rem;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.reset-link {
  border: none;
  background: transparent;
  color: #b9b2a5;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease;
}

.reset-link:hover,
.reset-link:focus-visible {
  color: #f2ca50;
  outline: none;
}

.messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 1.5rem;
}

.chat-scroll::-webkit-scrollbar {
  width: 6px;
}

.chat-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.12);
  border-radius: 999px;
}

.session-stamp {
  display: inline-flex;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: #b9b2a5;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  max-width: 100%;
}

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

.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.assistant-avatar {
  background: rgba(242, 202, 80, 0.1);
  color: #f2ca50;
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.user-avatar {
  background: rgba(255, 255, 255, 0.035);
  color: #ece8df;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bubble {
  max-width: min(46rem, 100%);
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: #2a2928;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(236, 232, 223, 0.94);
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.user .bubble {
  background: rgba(242, 202, 80, 0.06);
  border-color: rgba(212, 175, 55, 0.18);
}

.message-text {
  margin: 0;
  font-size: 0.98rem;
}

.message-meta {
  display: block;
  margin-top: 0.8rem;
  color: #a8a090;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.typing-row {
  display: none;
  align-items: center;
  gap: 0.9rem;
  padding-top: 0.25rem;
}

.typing-row.visible {
  display: flex;
}

.typing-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.65rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.typing-pill span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #f2ca50;
  opacity: 0.25;
  animation: pulse 1.2s infinite;
}

.typing-pill span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-pill span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
}

.chat-input {
  width: 100%;
  min-height: 3.6rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  background: #2a2928 !important;
  color: #ece8df !important;
  caret-color: #f2ca50;
  padding: 0 1.1rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.chat-input:hover,
.chat-input:focus,
.chat-input:active {
  background: #2a2928 !important;
  color: #ece8df !important;
}

.chat-input:focus {
  border-color: rgba(242, 202, 80, 0.34);
  box-shadow: 0 0 0 4px rgba(242, 202, 80, 0.08);
}

.chat-input::placeholder {
  color: rgba(185, 178, 165, 0.55);
}

.chat-input:-webkit-autofill,
.chat-input:-webkit-autofill:hover,
.chat-input:-webkit-autofill:focus,
.chat-input:-webkit-autofill:active {
  -webkit-text-fill-color: #ece8df;
  -webkit-box-shadow: 0 0 0 1000px #2a2928 inset;
  transition: background-color 99999s ease-in-out 0s;
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  min-height: 3.6rem;
  border: none;
  border-radius: 0.95rem;
  background: #f2ca50;
  color: #231c0b;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.send-button:hover:not(:disabled),
.send-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
  outline: none;
}

.send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.composer-note {
  margin: 0.85rem 0 0;
  color: #8e887d;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 15, 15, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.18);
  color: #ece8df;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
  z-index: 60;
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .panel-height {
    height: auto;
  }

  .context-panel {
    min-height: 0;
  }

  .context-content {
    height: auto;
  }

  .scope-note {
    margin-top: 0;
  }

  .chat-shell {
    min-height: 36rem;
  }
}

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .chat-shell-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .messages-scroll {
    padding: 1.35rem 1rem 1rem;
  }

  .composer-shell {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }
}
