.message-stream-container {
  @apply relative flex-1 min-h-0 flex flex-col overflow-hidden;
}

.connection-status {
  @apply grid items-center px-4 py-2 gap-4;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "info shortcut meta";
  background-color: var(--surface-secondary);
  border-bottom: 1px solid var(--border-base);
}

.connection-status-menu {
  display: none;
  grid-area: menu;
}

.connection-status--compact {
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "menu shortcut meta"
    "info info info";
  row-gap: 0.5rem;
}

.connection-status--compact .connection-status-menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.connection-status--compact .connection-status-info {
  justify-self: stretch;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.connection-status--compact .connection-status-usage {
  justify-content: center;
  width: 100%;
}

.connection-status--compact .connection-status-shortcut {
  justify-self: center;
}

.connection-status--compact .connection-status-meta {
  justify-self: end;
}

.session-sidebar-menu-button {
  @apply inline-flex items-center justify-center border rounded-md px-2 py-1 text-sm font-medium;
  border-color: var(--border-base);
  background-color: transparent;
  color: var(--text-primary);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.session-sidebar-menu-button:hover {
  background-color: var(--surface-hover);
}

.session-sidebar-menu-button:focus-visible {
  @apply ring-2 ring-offset-1;
  ring-color: var(--accent-primary);
  ring-offset-color: var(--surface-secondary);
}

.session-sidebar-menu-icon {
  font-size: var(--font-size-base);
  line-height: 1;
}

.status-indicator {
  @apply flex items-center gap-1.5 text-xs;
  color: var(--text-muted);
}

.status-indicator .status-dot {
  @apply w-2 h-2 rounded-full;
}

.status-indicator .status-text {
  display: inline-block;
}

@media (max-width: 1024px) {
  .status-indicator .status-text {
    display: none;
  }
}

.connection-status-info {
  @apply flex flex-wrap items-center gap-3 text-sm font-medium;
  grid-area: info;
  justify-self: center;
  justify-content: center;
  text-align: center;
}

.connection-status-usage {
  @apply flex flex-wrap items-center justify-center gap-2 text-xs;
  color: var(--text-primary);
}

.connection-status-shortcut {
  grid-area: shortcut;
  justify-self: center;
  text-align: center;
}

.connection-status-meta {
  grid-area: meta;
  justify-self: end;
}

.connection-status-text {
  color: var(--text-muted);
}

.connection-status-shortcut-action {
  @apply flex items-center justify-center gap-2;
}

.connection-status-button {
  @apply inline-flex items-center gap-2 px-3 py-1 text-sm font-medium border rounded-md transition-colors;
  border-color: var(--border-base);
  background-color: var(--surface-base);
  color: var(--text-primary);
}

.connection-status-button:hover {
  background-color: var(--surface-hover);
}

.connection-status-button:focus-visible {
  @apply ring-2 ring-offset-1;
  ring-color: var(--accent-primary);
  ring-offset-color: var(--surface-secondary);
}

.connection-status-shortcut-hint {
  @apply inline-flex items-center;
  color: var(--text-secondary);
}

@media (pointer: coarse) {
  .connection-status-shortcut-hint {
    display: none;
  }

  .connection-status-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .connection-status {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "menu shortcut meta"
      "info info info";
    row-gap: 0.5rem;
  }

  .connection-status-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .connection-status-info {
    justify-self: stretch;
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .connection-status-usage {
    justify-content: center;
    width: 100%;
  }

  .connection-status-shortcut {
    justify-self: center;
  }

  .connection-status-meta {
    justify-self: end;
  }
}

.message-scroll-button-wrapper {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.message-scroll-button {
  @apply inline-flex items-center justify-center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-base);
  background-color: transparent;
  color: var(--text-primary);
  box-shadow: var(--scroll-elevation-shadow);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.message-scroll-button:hover {
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.message-scroll-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface-base), 0 0 0 4px var(--accent-primary);
}

.message-scroll-icon {
  font-size: var(--font-size-lg);
  color: var(--accent-primary);
}

.message-quote-popover {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.message-quote-button-group {
  pointer-events: auto;
  display: inline-flex;
  border-radius: 9999px;
  border: 1px solid var(--list-item-highlight-border);
  background-color: var(--list-item-highlight-bg-solid);
  box-shadow: var(--panel-shadow, 0 4px 16px rgba(0, 0, 0, 0.2));
  overflow: hidden;
}

.message-quote-button {
  pointer-events: auto;
  @apply inline-flex items-center justify-center;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  background-color: transparent;
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.message-quote-button + .message-quote-button {
  border-left: 1px solid var(--list-item-highlight-border);
}

.message-quote-button:hover {
  background-color: var(--surface-hover);
}

.message-quote-button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-primary);
}
