/* FastAgentPanel Animations and Polish */

/* Slide-in animation for panel */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Thread list collapse/expand animation */
@keyframes collapseWidth {
  from {
    width: 280px;
  }

  to {
    width: 60px;
  }
}

@keyframes expandWidth {
  from {
    width: 60px;
  }

  to {
    width: 280px;
  }
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Scale-in animation */
@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Pulse animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Shimmer animation for loading */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

/* Bounce animation */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* Spin animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Gradient animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Apply animations to FastAgentPanel */
.fast-agent-panel {
  animation: slideInRight 0.25s cubic-bezier(0.32, 0.72, 0, 1);

  /* Base layout - overlay mode (fixed positioning) */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 620px;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  background: var(--bg-primary, #ffffff);
  box-shadow: -1px 0 0 0 var(--border-color), -10px 0 38px rgba(15, 23, 42, 0.08);
}

/* Wide / split-view mode - expands panel width */
.fast-agent-panel.wide-mode {
  width: 900px;
  transition: width 0.25s ease;
}

/* Sidebar variant - fills container instead of fixed overlay */
.fast-agent-panel.sidebar-mode {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: auto;
  box-shadow: none;
  animation: none;
  overflow: hidden;
  background: var(--bg-primary, #ffffff);
  border-left: 0;
  border-radius: 0;
}

.fast-agent-panel.sidebar-mode .glass-header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.fast-agent-panel.sidebar-mode .fast-agent-panel-content {
  background: var(--bg-primary, #ffffff);
}

/* Panel header */
.fast-agent-panel-header {
  flex-shrink: 0;
  padding: 1rem;
  background: var(--bg-primary, #fff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

/* Panel content area - critical: contains overflow */
.fast-agent-panel-content {
  flex: 1 1 0%;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

/* Main chat area inside content */
.fast-agent-panel-content>.flex-1 {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Scrollable message area */
.fast-agent-panel-content .overflow-y-auto {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Fix text overflow in message content */
.fast-agent-panel-content * {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.fast-agent-panel-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-width: 100%;
}

.fast-agent-panel-content code {
  word-break: break-word;
}

.fast-agent-panel-content p,
.fast-agent-panel-content li,
.fast-agent-panel-content span {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Panel sidebar (thread list) */
.panel-sidebar {
  width: 0;
  max-width: 0;
  flex: 0 0 0px;
  overflow: hidden;
  transition: width 0.2s ease, max-width 0.2s ease, flex-basis 0.2s ease;
}

.panel-sidebar.visible {
  width: 240px;
  max-width: 240px;
  flex: 0 0 240px;
}

/* On narrow viewports, sidebar overlays content instead of stealing inline space */
@media (max-width: 767px) {
  .fast-agent-panel:not(.sidebar-mode) .panel-sidebar.visible {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
    background: var(--bg-primary, #151413);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
}

/* On medium viewports (tablet), cap sidebar width to prevent content crush */
@media (min-width: 768px) and (max-width: 1023px) {
  .fast-agent-panel:not(.sidebar-mode) .panel-sidebar.visible {
    width: 200px;
    max-width: 200px;
    flex: 0 0 200px;
  }
}

/* Message bubble animations */
.message-bubble-container {
  animation: fadeIn 0.2s ease-out;
}

/* Thread item hover effect */
.thread-item {
  transition: all 0.12s cubic-bezier(0.32, 0.72, 0, 1);
}

.thread-item:hover {
  transform: translateX(2px);
}

/* Button hover effects */
.icon-button,
.thread-action-btn,
.export-option {
  transition: all 0.12s cubic-bezier(0.32, 0.72, 0, 1);
}

.icon-button:hover,
.thread-action-btn:hover {
  transform: scale(1.05);
}

.export-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Fast mode toggle animation */
.fast-mode-toggle.active {
  animation: pulse 2s infinite;
}

/* Streaming cursor blink */
.streaming-cursor {
  animation: pulse 1s infinite;
}

/* Loading shimmer */
.loading-shimmer {
  background: linear-gradient(90deg,
      var(--bg-secondary) 0%,
      var(--bg-tertiary) 50%,
      var(--bg-secondary) 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Smooth transitions — Linear spring easing */
* {
  transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Focus states — refined glow instead of harsh outline */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary, #fff), 0 0 0 4px var(--accent-primary, #5E6AD2), 0 0 12px rgba(94, 106, 210, 0.15);
}

/* Disabled states */
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Selection styling */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

/* Tooltip animations */
[title]:hover::after {
  animation: fadeIn 0.2s ease-out;
}

/* Modal overlay animations */
.export-menu-overlay,
.settings-overlay,
.delete-modal-overlay {
  animation: fadeIn 0.2s ease-out;
}

.export-menu,
.settings-panel,
.delete-modal {
  animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient backgrounds */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* Micro-interactions */
.clickable {
  cursor: pointer;
  user-select: none;
}

.clickable:active {
  transform: scale(0.98);
}

/* Loading states */
.loading-dots::after {
  content: '';
  animation: pulse 1.5s infinite;
}

/* Success/Error states */
.success-flash {
  animation: fadeIn 0.3s ease-out;
  background: rgba(34, 197, 94, 0.1);
}

.error-flash {
  animation: fadeIn 0.3s ease-out;
  background: rgba(239, 68, 68, 0.1);
}

/* Responsive animations */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode transitions */
@media (prefers-color-scheme: dark) {
  * {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {

  button,
  input,
  textarea {
    border-width: 2px;
  }
}

/* Streaming UI Optimizations */

/* Smooth fade-in for streaming items */
@keyframes fadeInSmooth {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeInSmooth 0.2s ease-out;
}

/* GPU-accelerated expand/collapse */
@keyframes expandHeight {
  from {
    opacity: 0;
    max-height: 0;
  }

  to {
    opacity: 1;
    max-height: 500px;
  }
}

.animate-expandHeight {
  animation: expandHeight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth step counter increment */
@keyframes stepCountPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.animate-stepCountPulse {
  animation: stepCountPulse 0.3s ease-out;
}

/* Streaming message container - minimal layout thrash */
.streaming-message-container {
  contain: layout style paint;
  will-change: contents;
}

/* Timeline item smooth transitions */
.timeline-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
  /* Enable GPU acceleration */
}

.timeline-item:hover {
  transform: translateX(2px) translateZ(0);
}

/* Tool result popover smooth appearance */
.tool-result-popover {
  animation: fadeInSmooth 0.2s ease-out;
  transform-origin: top center;
}

/* Processing indicator smooth animation */
.processing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeInSmooth 0.2s ease-out;
}

.processing-indicator-spinner {
  animation: spin 1s linear infinite;
}

/* Smooth scroll behavior */
.smooth-scroll-container {
  scroll-behavior: smooth;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Prevent layout shift during streaming */
.streaming-content {
  contain: content;
}

/* Optimize message bubble rendering */
.message-bubble {
  contain: layout style paint;
  will-change: auto;
}

.message-bubble.streaming {
  will-change: contents;
}

/* Step timeline line - smooth animation */
.timeline-line {
  transition: background-color 0.3s ease-out;
}

/* Typing indicator smooth animation */
@keyframes typingDot {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.typing-dot {
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Document Selector Panel Styles */
.document-context-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-primary-bg, rgba(59, 130, 246, 0.1));
  border: 1px solid var(--accent-primary, #3b82f6);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary, #3b82f6);
  animation: scaleIn 0.2s ease-out;
}

.doc-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--accent-primary, #3b82f6);
  color: white;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
}

.doc-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.document-selector-panel {
  position: absolute;
  top: 3.5rem;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--bg-secondary, #FAFAFA);
  border: 1px solid var(--border-color, #e5e5e5);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s ease-out;
}

.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.selector-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #000);
}

.close-button {
  background: none;
  border: none;
  color: var(--text-secondary, #666);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  transition: background-color 0.2s, color 0.2s;
}

.close-button:hover {
  background-color: var(--bg-hover, #e5e5e5);
  color: var(--text-primary, #000);
}

.selector-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selector-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
  line-height: 1.4;
}

.selected-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc-ids {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.doc-id-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e5e5e5);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-primary, #000);
  animation: slideInRight 0.2s ease-out;
}

.doc-id {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-button {
  background: none;
  border: none;
  color: var(--text-secondary, #666);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.remove-button:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.selector-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color, #e5e5e5);
}

.clear-button {
  flex: 1;
  padding: 0.5rem;
  background: var(--bg-hover, #e5e5e5);
  border: 1px solid var(--border-color, #d5d5d5);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary, #000);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.clear-button:hover:not(:disabled) {
  background: var(--accent-primary-bg, rgba(59, 130, 246, 0.1));
  border-color: var(--accent-primary, #3b82f6);
  color: var(--accent-primary, #3b82f6);
}

.clear-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Header indicator for active document selection */
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Skills Panel Overlay */
.skills-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.skills-panel {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.2s ease-out;
}

/* Skills button - now uses inline Tailwind classes in FastAgentPanel.tsx */

/* ═══════════════════════════════════════════════════════════════════
   PREMIUM POLISH — message entrance, typing indicator, prose, input
   ═══════════════════════════════════════════════════════════════════ */

/* Message entrance animation (Claude/ChatGPT pattern) */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-enter {
  animation: messageSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Skeleton shimmer loading state (ChatGPT / Claude pattern) */
@keyframes shimmerSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-shimmer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0;
}

.skeleton-shimmer .skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-secondary, #f0f0ef);
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer .skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmerSlide 1.5s ease-in-out infinite;
}

@media (prefers-color-scheme: dark) {
  .skeleton-shimmer .skeleton-line {
    background: rgba(255, 255, 255, 0.06);
  }
  .skeleton-shimmer .skeleton-line::after {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 100%
    );
  }
}

.skeleton-shimmer .skeleton-line:nth-child(1) { width: 85%; }
.skeleton-shimmer .skeleton-line:nth-child(2) { width: 70%; animation-delay: 0.15s; }
.skeleton-shimmer .skeleton-line:nth-child(3) { width: 55%; animation-delay: 0.3s; }

/* Typing indicator — 3-dot bounce (kept as fallback) */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f5f5f4);
  border-radius: 16px;
  border: 1px solid var(--border-color, #e5e5e5);
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted, #a1a1aa);
  animation: typingDot 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* ═══════════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS — button press, spring hover, chip feedback
   ═══════════════════════════════════════════════════════════════════ */

/* Press-scale: shrink on click, bounce back */
.press-scale {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease;
}

.press-scale:active {
  transform: scale(0.95);
}

/* Hover-lift: subtle Y lift + shadow on hover */
.hover-lift {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hover-lift:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Action button micro-interaction */
.action-btn {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.15s ease,
              color 0.15s ease;
}

.action-btn:active {
  transform: scale(0.88);
}

/* Suggestion chip press feedback */
.chip-press {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.15s ease,
              box-shadow 0.15s ease;
}

.chip-press:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chip-press:active {
  transform: scale(0.96);
  box-shadow: none;
}

/* Dropdown entrance — scale from anchor point */
.dropdown-enter {
  animation: dropdownScaleIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: var(--dropdown-origin, bottom center);
}

@keyframes dropdownScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Input bar focus glow */
.input-bar-container {
  border: 1.5px solid var(--border-color, #e5e5e5);
  border-radius: 12px;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-bar-container:focus-within {
  border-color: var(--accent-primary, #5E6AD2);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .input-bar-container:focus-within {
    border-color: var(--accent-primary, #7C8AE4);
    box-shadow: 0 0 0 3px rgba(124, 138, 228, 0.12), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* Streaming blinking caret */
@keyframes caretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.streaming-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-primary, #5E6AD2);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: caretBlink 0.8s step-end infinite;
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .streaming-caret {
    animation: none;
    opacity: 0.6;
  }
}

/* Markdown prose refinements for AI responses */
.prose-agent h1,
.prose-agent h2,
.prose-agent h3,
.prose-agent h4 {
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.prose-agent h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.prose-agent h2 { font-size: 1.1rem; letter-spacing: -0.015em; }
.prose-agent h3 { font-size: 1rem; }

.prose-agent p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1.65;
}

.prose-agent ul,
.prose-agent ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-left: 1.5em;
}

.prose-agent li {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
  line-height: 1.6;
}

.prose-agent ul > li {
  list-style-type: disc;
}

.prose-agent ol > li {
  list-style-type: decimal;
}

.prose-agent li > ul,
.prose-agent li > ol {
  margin-top: 0.25em;
  margin-bottom: 0;
}

.prose-agent blockquote {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
  padding-left: 1em;
  border-left: 3px solid var(--border-color, #e5e5e5);
  color: var(--text-secondary);
  font-style: italic;
}

.prose-agent table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75em;
  margin-bottom: 0.75em;
  font-size: 0.8125rem;
}

.prose-agent th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.prose-agent td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.prose-agent tr:last-child td {
  border-bottom: none;
}

.prose-agent hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1em 0;
}

.prose-agent strong {
  font-weight: 600;
  color: var(--text-primary);
}

.prose-agent a {
  color: #2563eb;
  text-decoration: none;
}

.prose-agent a:hover {
  text-decoration: underline;
}

/* ===== TIER 6/7: PREMIUM UI ===== */

/* Glassmorphism header */
.glass-header {
  background: var(--bg-primary, #ffffff);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  box-shadow: none;
}

/* Glass surface — reusable for inputs, dropdowns, popovers */
.glass-surface {
  background: var(--bg-primary, #ffffff);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-color, #e5e7eb);
}

@media (prefers-color-scheme: dark) {
  .glass-header {
    background: #11161c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .glass-surface {
    background: #171b20;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.dark .glass-header {
  background: #11161c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.dark .glass-surface {
  background: #171b20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* Thread item hover elevation */
.thread-item {
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
.thread-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dark .thread-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Timestamp/action crossfade — smooth instead of instant show/hide */
.thread-time {
  transition: opacity 150ms ease;
}
.group:hover .thread-time {
  opacity: 0;
}
.thread-actions {
  opacity: 0;
  transition: opacity 150ms ease;
}
.group:hover .thread-actions {
  opacity: 1;
}

/* Spring-eased typing dots */
@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.typing-dot {
  animation: dot-bounce 1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

/* ChatGPT-style skeleton shimmer placeholder */
@keyframes skeletonShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary, #e8e8e8) 40%,
    var(--bg-secondary) 80%
  );
  background-size: 800px 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
}

.skeleton-block .skeleton-line {
  height: 12px;
  border-radius: 6px;
}

.skeleton-block .skeleton-line:nth-child(1) { width: 92%; }
.skeleton-block .skeleton-line:nth-child(2) { width: 78%; }
.skeleton-block .skeleton-line:nth-child(3) { width: 85%; }
.skeleton-block .skeleton-line:nth-child(4) { width: 60%; }

/* Message entrance animation — slide up + fade */
@keyframes msgEntrance {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-entrance {
  animation: msgEntrance 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Text selection floating toolbar */
.selection-toolbar {
  position: absolute;
  z-index: 100;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: scaleIn 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom center;
}

.selection-toolbar button {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.selection-toolbar button:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Persistent status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.status-bar .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-bar .status-dot.connected { background: #22c55e; }
.status-bar .status-dot.disconnected { background: #ef4444; }

/* Smart action chips */
.smart-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.smart-action-chip:hover {
  background: var(--bg-tertiary, var(--bg-hover));
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Reasoning/thinking disclosure */
.thinking-disclosure {
  border-left: 2px solid var(--border-color);
  margin-left: 4px;
  padding-left: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.thinking-disclosure summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
  user-select: none;
  list-style: none;
}

.thinking-disclosure summary::before {
  content: '▸ ';
  transition: transform 0.2s;
  display: inline-block;
}

.thinking-disclosure[open] summary::before {
  content: '▾ ';
}

/* Focus mode full-width */
.fast-agent-panel.focus-mode {
  width: 100vw;
  max-width: 100vw;
  transition: width 0.3s ease;
}

/* Button press micro-interaction */
.press-scale:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

/* ===== TIER 9: LINK PREVIEW + TIMELINE ===== */

/* Rich link preview card */
.link-preview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: background 0.15s, border-color 0.15s;
}

.link-preview-card:hover {
  background: var(--bg-hover, var(--bg-tertiary));
  border-color: var(--text-muted);
}

/* Confidence meter dots */
.confidence-meter {
  display: flex;
  gap: 2px;
  align-items: center;
}

.confidence-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: background 0.3s;
}

/* Timeline node */
.timeline-node {
  position: relative;
  padding-left: 24px;
  padding-top: 6px;
  padding-bottom: 6px;
  transition: background 0.15s;
  border-radius: 0 8px 8px 0;
}

.timeline-node:hover {
  background: var(--bg-secondary);
}

.timeline-node::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.timeline-node.user::before { background: #3b82f6; }
.timeline-node.assistant::before { background: #22c55e; }

/* Context pruning row */
.context-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 10px;
  transition: background 0.1s;
}

.context-row:hover {
  background: var(--bg-secondary);
}

/* Keyboard shortcut badge */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 9px;
  font-family: ui-monospace, monospace;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  line-height: 1.4;
  box-shadow: 0 1px 0 var(--border-color);
}

/* ===== TIER 12: ARTIFACTS + FOCUS + TONE ===== */

/* Artifacts/Canvas panel slide-in */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.artifacts-panel {
  animation: slideInRight 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Focus mode picker animation */
@keyframes scaleInUp {
  from { transform: scale(0.9) translateY(4px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.focus-picker-popup {
  animation: scaleInUp 0.15s ease-out;
}

/* Citation hover preview card */
.cite-hover-card {
  animation: scaleIn 0.12s ease-out;
  transform-origin: bottom center;
}

/* Quick action chip hover lift */
.quick-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Message scroll highlight pulse */
@keyframes highlightPulse {
  0% { outline-color: var(--accent-primary, #3b82f6); }
  50% { outline-color: transparent; }
  100% { outline-color: var(--accent-primary, #3b82f6); }
}

.msg-highlight {
  animation: highlightPulse 0.8s ease-in-out 2;
  outline: 2px solid var(--accent-primary, #3b82f6);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Tone chip active state */
.tone-active {
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.1);
  border-color: var(--accent-primary, #3b82f6);
  color: var(--accent-primary, #3b82f6);
  font-weight: 500;
}

/* ===== TIER 13: ANALYTICS + VOICE + TABLES ===== */

/* Voice recording pulse */
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.voice-recording {
  animation: voicePulse 1.5s ease-in-out infinite;
}

/* Analytics chart bar hover */
.analytics-bar {
  transition: opacity 0.15s, transform 0.15s;
}

.analytics-bar:hover {
  opacity: 1 !important;
  transform: scaleY(1.05);
  transform-origin: bottom;
}

/* Drag-drop overlay */
@keyframes dropPulse {
  0%, 100% { border-color: #3b82f6; }
  50% { border-color: #60a5fa; }
}

.drop-overlay {
  animation: dropPulse 1.5s ease-in-out infinite;
}

/* RLHF feedback button active */
.rlhf-active-up {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.rlhf-active-down {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Edit diff view */
.edit-diff-old {
  background: rgba(239, 68, 68, 0.05);
  text-decoration: line-through;
  color: #ef4444;
}

.edit-diff-new {
  background: rgba(34, 197, 94, 0.05);
  color: #22c55e;
}

/* Code execution output */
.code-output {
  animation: scaleIn 0.15s ease-out;
  transform-origin: top center;
}

/* Table hover row */
.table-hover-row:hover {
  background: var(--bg-secondary);
}

/* Branch tree node */
.branch-node {
  transition: background 0.15s;
  cursor: pointer;
}

.branch-node:hover {
  background: var(--bg-secondary);
}

.branch-node.active {
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.08);
}

/* Context indicator outside */
.ctx-outside {
  opacity: 0.5;
  border-left: 2px solid #f59e0b;
  padding-left: 8px;
}

/* Font size slider thumb */
input[type="range"].font-slider::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary, #3b82f6);
  cursor: pointer;
}

/* ===== TIER 14: ENTERPRISE & POWER USER ===== */

/* High contrast mode */
.fast-agent-panel.high-contrast {
  --text-primary: #000;
  --text-secondary: #1a1a1a;
  --text-muted: #333;
  --bg-primary: #fff;
  --bg-secondary: #f0f0f0;
  --border-color: #666;
  --accent-primary: #0050d8;
}

@media (prefers-color-scheme: dark) {
  .fast-agent-panel.high-contrast {
    --text-primary: #fff;
    --text-secondary: #e0e0e0;
    --text-muted: #bbb;
    --bg-primary: #000;
    --bg-secondary: #1a1a1a;
    --border-color: #888;
    --accent-primary: #6eb5ff;
  }
}

/* Conversation starters grid */
.starter-card {
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.starter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Context menu animation */
@keyframes ctxMenuIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.ctx-menu {
  animation: ctxMenuIn 0.1s ease-out;
}

/* Memory panel item */
.memory-item {
  transition: background 0.1s, border-color 0.1s;
}

.memory-item:hover {
  border-color: var(--text-muted);
}

/* Reply-to indicator */
.reply-indicator {
  border-left: 3px solid var(--accent-primary, #3b82f6);
  background: var(--bg-secondary);
  border-radius: 0 8px 0 0;
}

/* Streaming speed badge */
.stream-speed {
  font-variant-numeric: tabular-nums;
  font-size: 8px;
  opacity: 0.8;
}

/* Performance tooltip */
.perf-badge {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Image paste preview */
.img-preview-thumb {
  transition: transform 0.15s, box-shadow 0.15s;
}

.img-preview-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Language detection chip */
@keyframes langChipIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-chip {
  animation: langChipIn 0.2s ease-out;
}

/* Scheduled message indicator */
.sched-indicator {
  animation: pulse 2s ease-in-out infinite;
}

/* Import dialog textarea */
.import-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--accent-primary, #3b82f6);
}

/* Mobile responsive — full-screen takeover (primary interface on mobile) */
@media (max-width: 767px) {
  .fast-agent-panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    border-left: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--bg-primary, #ffffff) !important;
    z-index: 1000;
    animation: slideInUp 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .fast-agent-panel .glass-header {
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .fast-agent-panel .status-bar {
    font-size: 8px;
    padding: 3px 8px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .fast-agent-panel .panel-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    width: 280px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .fast-agent-panel-content {
    flex-direction: column;
  }

  /* Input bar safe area for iPhone notch / home indicator */
  .fast-agent-panel .fa-input-bar-wrapper {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0.8;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  @media (max-width: 767px) {
    .fast-agent-panel {
      animation: none !important;
    }
  }
}

/* Touch-friendly larger targets on mobile */
@media (pointer: coarse) {
  .smart-action-chip {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 12px;
  }

  .action-btn {
    min-width: 36px;
    min-height: 36px;
  }
}

/* Keyboard focused message */
.msg-keyboard-focus {
  outline: 2px solid var(--accent-primary, #3b82f6);
  outline-offset: 4px;
  border-radius: 12px;
  transition: outline 0.2s;
}

/* Snapshot saved toast */
@keyframes snapFlash {
  0% { background: rgba(34, 197, 94, 0.1); }
  100% { background: transparent; }
}

.snap-flash {
  animation: snapFlash 0.8s ease-out;
}

/* ===== TIER 15: AGENT + PERF + A11Y + POLISH ===== */

/* Persona picker dropdown */
@keyframes personaDropIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.persona-picker {
  animation: personaDropIn 0.12s ease-out;
}

.persona-option {
  transition: background 0.1s, color 0.1s;
}

.persona-option[aria-selected="true"] {
  font-weight: 500;
}

/* Tool approval banner */
@keyframes approvalSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tool-approval-card {
  animation: approvalSlideIn 0.2s ease-out;
}

.tool-approval-card .approve-btn {
  transition: background 0.15s, transform 0.1s;
}

.tool-approval-card .approve-btn:active {
  transform: scale(0.95);
}

/* Multi-agent handoff cards */
.handoff-card {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.handoff-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@keyframes handoffPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.handoff-active {
  animation: handoffPulse 2s ease-in-out infinite;
}

/* Skip-to-content (a11y) */
.sr-only:focus {
  position: absolute;
  clip: auto;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: nowrap;
}

/* Focus trap outline for modals */
[role="dialog"]:focus-visible,
[role="listbox"]:focus-visible {
  outline: 2px solid var(--accent-primary, #3b82f6);
  outline-offset: 2px;
}

/* Dark mode refinements */
@media (prefers-color-scheme: dark) {
  .fast-agent-panel {
    --shadow-overlay: 0 8px 32px rgba(0, 0, 0, 0.5);
  }

  .fast-agent-panel .glass-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .fast-agent-panel .status-bar {
    background: rgba(0, 0, 0, 0.3);
    border-top-color: rgba(255, 255, 255, 0.06);
  }
}

/* Smooth transitions for theme switching */
.fast-agent-panel,
.fast-agent-panel * {
  transition-property: background-color, border-color, color;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}

/* Exclude animation-heavy elements from the blanket transition */
.fast-agent-panel .animate-pulse,
.fast-agent-panel .animate-spin,
.fast-agent-panel [class*="animate-"] {
  transition: none;
}

/* Message bubble entrance refinement */
.msg-entrance {
  animation: msgSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes msgSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Subtle hover lift for interactive cards */
.interactive-card {
  transition: transform 0.15s, box-shadow 0.15s;
}

.interactive-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.interactive-card:active {
  transform: translateY(0);
}

/* Overlay backdrop blur consistency */
.overlay-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Scrollbar styling */
.fast-agent-panel ::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.fast-agent-panel ::-webkit-scrollbar-track {
  background: transparent;
}

.fast-agent-panel ::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
  opacity: 0.3;
}

.fast-agent-panel ::-webkit-scrollbar-thumb:hover {
  opacity: 0.6;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .fast-agent-panel,
  .fast-agent-panel * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Bottom Sheet (mobile < 1024px) ─────────────────────────────────── */

/* Backdrop behind the bottom sheet */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-sheet-backdrop.backdrop-hidden {
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet-backdrop.backdrop-visible {
  opacity: 1;
  pointer-events: auto;
}

/* The sheet container — slides up from bottom via translateY */
.bottom-sheet-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary, #151413);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  overflow: hidden;
  /* Height set via inline style; transform controls visible portion */
  height: 95vh;
  max-height: 95vh;
}

/* Disable transition while user is actively dragging */
.bottom-sheet-container.dragging {
  transition: none !important;
}

/* Three states expressed as translateY offsets from the 95vh container */

/* Peek: only bottom 80px visible → translateY(calc(95vh - 80px)) */
.bottom-sheet-container.sheet-peek {
  transform: translateY(calc(95vh - 80px));
}

/* Half: 60% viewport visible → translateY(calc(95vh - 60vh)) = translateY(35vh) */
.bottom-sheet-container.sheet-half {
  transform: translateY(35vh);
}

/* Full: 95% viewport visible → translateY(0) */
.bottom-sheet-container.sheet-full {
  transform: translateY(0);
}

/* Hidden (closed) */
.bottom-sheet-container.sheet-closed {
  transform: translateY(100%);
}

/* Drag handle — the grab bar at top of the sheet */
.bottom-sheet-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 6px;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.bottom-sheet-handle:active {
  cursor: grabbing;
}

.bottom-sheet-handle-bar {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.15s;
}

.bottom-sheet-handle:hover .bottom-sheet-handle-bar,
.bottom-sheet-handle:active .bottom-sheet-handle-bar {
  background: rgba(255, 255, 255, 0.45);
}

/* Override panel styles when inside bottom sheet */
.bottom-sheet-container .fast-agent-panel {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: auto;
  box-shadow: none;
  animation: none;
  border-radius: 0;
  flex: 1 1 0%;
  min-height: 0;
}

/* Reduced motion: skip sheet transitions */
@media (prefers-reduced-motion: reduce) {
  .bottom-sheet-container,
  .bottom-sheet-backdrop {
    transition-duration: 0.01ms !important;
  }
}

/* Print styles - hide panel */
@media print {
  .fast-agent-panel,
  .bottom-sheet-container,
  .bottom-sheet-backdrop {
    display: none !important;
  }
}
