/* MediChat clean chat UX patch: reduces stacked workspace clutter,
   restores a persistent conversation-first composer,
   and moves starters/specialties into a welcome panel. */

body.medix-clean-mode {
  background:
    radial-gradient(circle at top, rgba(123,63,228,0.14), transparent 28%),
    var(--bg-color);
}

body.medix-clean-mode #mxWorkspaceBar,
body.medix-clean-mode #mxWorkspaceDeck,
body.medix-clean-mode #mxStageTopbar,
body.medix-clean-mode .mx-bottom-nav,
body.medix-clean-mode .mx-sheet,
body.medix-clean-mode .mx-sheet-backdrop {
  display: none !important;
}

body.medix-clean-mode #mxViewportShell {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
}

body.medix-clean-mode #mxResultsStage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.medix-clean-mode #chatContainer {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-width: none !important;
  padding: 18px clamp(12px, 2.5vw, 24px) 24px !important;
  gap: 14px !important;
  scroll-padding-bottom: 190px !important;
}

body.medix-clean-mode .message {
  max-width: min(920px, 100%) !important;
}

body.medix-clean-mode .ai-message,
body.medix-clean-mode .user-message {
  border-radius: 18px !important;
  box-shadow: 0 14px 32px rgba(0,0,0,0.16);
}

body.medix-clean-mode .input-container {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 120 !important;
  margin: 0 !important;
  padding: 12px clamp(12px, 2.5vw, 18px) calc(12px + var(--safe-area-inset-bottom)) !important;
  border-top: 1px solid rgba(255,255,255,0.10) !important;
  background: linear-gradient(180deg, rgba(36,37,48,0.74), rgba(27,28,37,0.96)) !important;
  backdrop-filter: blur(18px) !important;
  box-shadow: 0 -18px 44px rgba(0,0,0,0.28) !important;
}

body.medix-clean-mode .input-container .tools-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  gap: 8px !important;
  margin: 0 0 12px !important;
  padding: 2px 2px 6px !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.medix-clean-mode .input-container .tools-container::-webkit-scrollbar {
  display: none;
}

body.medix-clean-mode .tool-button,
body.medix-clean-mode .file-label {
  min-height: 44px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

body.medix-clean-mode .input-area {
  gap: 10px !important;
  align-items: flex-end !important;
  margin-bottom: 0 !important;
}

body.medix-clean-mode #userInput {
  min-height: 54px;
  max-height: min(34vh, 220px);
  border-radius: 18px;
  padding: 14px 16px;
}

body.medix-clean-mode #sendButton {
  min-width: 96px;
  height: 54px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

body.medix-clean-mode .disclaimer {
  max-width: 900px;
  margin: 10px auto 0;
  font-size: 11px;
}

body.medix-clean-mode #medixWelcomePanel {
  width: min(1040px, 100%);
  margin: 4px auto 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at top right, rgba(14,165,233,0.12), transparent 32%),
    linear-gradient(180deg, rgba(66,68,88,0.72), rgba(33,34,44,0.82));
  box-shadow: 0 18px 44px rgba(0,0,0,0.18);
}

body.medix-clean-mode .medix-welcome-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

body.medix-clean-mode .medix-welcome-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

body.medix-clean-mode .medix-welcome-copy strong {
  color: var(--text-light);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
}

body.medix-clean-mode .medix-welcome-copy p {
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  line-height: 1.6;
  max-width: 760px;
}

body.medix-clean-mode .medix-welcome-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body.medix-clean-mode .medix-meta-pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.medix-clean-mode .medix-welcome-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.medix-clean-mode #medixWelcomePanel #suggestionsContainer {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}

body.medix-clean-mode #medixWelcomePanel .suggestion-button {
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  flex: 0 0 auto !important;
}

body.medix-clean-mode #medixWelcomePanel .specialties-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px !important;
  margin: 0 !important;
}

body.medix-clean-mode #medixWelcomePanel .specialty-card {
  min-height: 132px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  box-shadow: none;
}

body.medix-clean-mode #medixWelcomePanel .specialty-card h3 {
  margin-bottom: 8px;
  color: var(--text-light);
  font-size: 15px;
}

body.medix-clean-mode #medixWelcomePanel .specialty-card p {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.medix-clean-mode .medix-hidden-card {
  display: none !important;
}

body.medix-clean-mode .mobile-toggle-buttons,
body.medix-clean-mode .model-selector {
  display: none !important;
}

body.medix-clean-mode header {
  padding-inline: clamp(12px, 2vw, 16px) !important;
}

body.medix-clean-mode .header-controls {
  gap: 8px !important;
}

body.medix-clean-mode .jobs-panel {
  z-index: 140;
}

@media (max-width: 1024px) {
  body.medix-clean-mode .status span,
  body.medix-clean-mode .model-pill {
    display: none !important;
  }

  body.medix-clean-mode .header-controls {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    gap: 6px !important;
  }

  body.medix-clean-mode .header-controls #jobsToggle,
  body.medix-clean-mode .header-controls #exportButton,
  body.medix-clean-mode .header-controls #newChatButton {
    display: none !important;
  }

  body.medix-clean-mode #headerMoreButton {
    display: inline-flex !important;
  }

  body.medix-clean-mode .input-container {
    border-radius: 20px 20px 0 0 !important;
  }

  body.medix-clean-mode #medixWelcomePanel {
    padding: 16px;
  }
}

@media (max-width: 760px) {
  body.medix-clean-mode .logo span,
  body.medix-clean-mode .agent-pill {
    display: none !important;
  }

  body.medix-clean-mode #chatContainer {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.medix-clean-mode .medix-welcome-head {
    flex-direction: column;
    margin-bottom: 14px;
  }

  body.medix-clean-mode .medix-welcome-meta {
    justify-content: flex-start;
  }

  body.medix-clean-mode #medixWelcomePanel .specialties-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  body.medix-clean-mode .profile-icon {
    width: 40px;
    height: 40px;
  }

  body.medix-clean-mode #sendButton {
    min-width: 84px;
  }

  body.medix-clean-mode #medixWelcomePanel {
    padding: 14px;
    border-radius: 20px;
  }

  body.medix-clean-mode #medixWelcomePanel .specialties-container {
    grid-template-columns: 1fr;
  }

  body.medix-clean-mode .jobs-panel {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    bottom: 12px !important;
  }
}
