/* Mobile sheet */
.agent-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.agent-mobile-sheet--open {
  pointer-events: auto;
}

.agent-mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  pointer-events: none;
  transition:
    background 0.3s ease,
    backdrop-filter 0.3s ease;
}

.agent-mobile-sheet-backdrop--open {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-backdrop--open {
  background: rgba(7, 10, 24, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.agent-mobile-sheet--plan .agent-mobile-sheet-backdrop--open {
  background: rgba(7, 10, 24, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.agent-mobile-sheet-panel {
  position: relative;
  width: min(100%, 720px);
  max-height: 85vh;
  --agent-mobile-sheet-translate: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.18);
  transform: translateY(var(--agent-mobile-sheet-translate));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.agent-mobile-sheet-panel--sidebar {
  background:
    radial-gradient(ellipse at 25% 0%, rgba(64, 27, 104, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(64, 27, 104, 0.12) 0%, transparent 50%),
    linear-gradient(175deg, #401b68 0%, #1c0f42 55%, #170d38 100%);
  border: 1px solid rgba(196, 181, 253, 0.16);
  box-shadow: 0 -18px 38px rgba(7, 10, 24, 0.48);
}

.agent-mobile-sheet-panel--plan {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(42, 27, 78, 0.5);
  border: 1px solid rgba(196, 181, 253, 0.16);
  box-shadow: 0 -18px 38px rgba(7, 10, 24, 0.48);
  -webkit-backdrop-filter: blur(30px) saturate(1.55);
  backdrop-filter: blur(30px) saturate(1.55);
  isolation: isolate;
}

.agent-mobile-sheet-panel--sidebar::before,
.agent-mobile-sheet-panel--plan::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(221, 214, 254, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%);
}

.agent-mobile-sheet-panel--plan::before {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}

.agent-mobile-sheet-panel--open {
  --agent-mobile-sheet-translate: 0%;
}

.agent-mobile-sheet-panel--expanded {
  max-height: 95vh;
  height: 95vh;
}

.agent-mobile-sheet-panel--dragging {
  transition: none;
}

.agent-mobile-sheet-grabber {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0 0;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.agent-mobile-sheet-grabber:active {
  cursor: grabbing;
}

.agent-mobile-sheet-grabber-bar {
  width: 2.75rem;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.35);
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-grabber-bar {
  background: rgba(221, 214, 254, 0.34);
}

.agent-mobile-sheet--plan .agent-mobile-sheet-grabber-bar {
  background: rgba(221, 214, 254, 0.34);
}

.agent-mobile-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1rem 0;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.agent-mobile-sheet-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.agent-mobile-sheet-titles {
  min-width: 0;
}

.agent-mobile-sheet-accessory {
  margin-left: auto;
}

.agent-mobile-sheet-heading .chat-context-switcher--drawer {
  width: auto;
}

.agent-mobile-sheet-heading .chat-context-switcher--drawer .chat-context-switcher__trigger {
  width: auto;
  max-width: 9.5rem;
  padding: 0.3rem 0.5rem;
}

.agent-mobile-sheet-heading .chat-context-switcher--drawer .chat-context-switcher__menu {
  width: min(14.5rem, 90vw);
}

.agent-mobile-sheet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.25);
  color: #b45309;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-icon {
  background: rgba(167, 139, 250, 0.16);
  color: #ddd6fe;
}

.agent-mobile-sheet--plan .agent-mobile-sheet-icon {
  background: rgba(167, 139, 250, 0.16);
  color: #ddd6fe;
}

.agent-mobile-sheet-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-title {
  color: rgba(255, 255, 255, 0.96);
}

.agent-mobile-sheet--plan .agent-mobile-sheet-title {
  color: rgba(255, 255, 255, 0.96);
}

.agent-mobile-sheet-subtitle {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.2rem;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-subtitle {
  color: rgba(226, 232, 240, 0.72);
}

.agent-mobile-sheet--plan .agent-mobile-sheet-subtitle {
  color: rgba(226, 232, 240, 0.72);
}

.agent-mobile-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: rgba(59, 130, 246, 0.12);
  color: #1e40af;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.agent-mobile-sheet--plan .agent-mobile-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.agent-mobile-sheet-close:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.agent-mobile-sheet--sidebar .agent-mobile-sheet-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.agent-mobile-sheet--plan .agent-mobile-sheet-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.agent-mobile-sheet-close:active {
  transform: scale(0.96);
}

.agent-mobile-sheet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}

.agent-mobile-sheet-body--padded {
  padding: 0 1rem 1.5rem;
}

.agent-mobile-sheet--plan .plan-panel {
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.agent-mobile-sheet--plan .plan-panel::before {
  display: none;
}
