/* Isolated mobile workspace; desktop rules and content remain intact. */
.mw-about, .mw-intro { display: none; }
.mw-dialog { border: 1px solid #64748b; border-radius: 12px; padding: 0; color: var(--text-primary, #e2e8f0); background: var(--bg-card, #111827); width: min(94vw, 680px); max-height: 90dvh; }
.mw-dialog::backdrop { background: #000a; }
.mw-dialog-head { display: flex; align-items: center; gap: 12px; padding: 12px; position: sticky; top: 0; background: var(--bg-card, #111827); z-index: 2; }
.mw-dialog-head h2 { font: 600 16px/1.4 system-ui, sans-serif; margin: 0; flex: 1; }
.mw-close, .mw-about { min-height: 44px; padding: 8px 10px; border: 1px solid #94a3b8; border-radius: 8px; background: #111827; color: #fff; font: 600 12px/1.3 system-ui, sans-serif; cursor: pointer; }
.mw-dialog-body { padding: 12px; }
.mw-dialog-body .fleet-sidebar { display: block !important; width: auto; max-height: none; overflow: visible; }
.mw-dialog-body #legal-notice { padding: 0 !important; margin-bottom: 16px; }
.mw-dialog-body #legal-notice > div > div { padding: 12px !important; }
.mw-dialog-body .welcome-card, .mw-dialog-body .m-welcome { padding: 12px; margin: 0 0 12px; }
@media (max-width: 900px) {
  body.mobile-workspace {
    position: fixed; top: var(--mw-top, 0px); left: 0; right: 0;
    height: var(--mw-height, 100dvh) !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important;
    display: flex !important; flex-direction: column; overflow: hidden !important;
  }
  .mobile-workspace .rat-hero, .mobile-workspace .m-header {
    flex: 0 0 auto; min-height: 0 !important; height: auto !important; max-height: 118px;
    padding: 0 !important; margin: 0 !important; position: relative;
    background-position: center; border-bottom: 1px solid #475569;
  }
  .mobile-workspace .rat-hero::before { background: #000b; }
  .mobile-workspace .rat-hero-inner, .mobile-workspace .m-header-left {
    padding: 10px 112px 10px 12px !important; width: 100%; min-width: 0;
  }
  .mobile-workspace .rat-hero h1, .mobile-workspace .m-header h1 {
    font: 650 16px/1.3 system-ui, sans-serif !important; margin: 0 0 3px !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-workspace .rat-hero .subtitle, .mobile-workspace .m-subtitle {
    font: 400 12px/1.35 system-ui, sans-serif !important; margin: 0 !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-workspace .mw-intro { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 400 12px/1.4 system-ui, sans-serif; color: #e2e8f0; margin: 5px 0 0; }
  .mobile-workspace .mw-about { display: block; position: absolute; z-index: 3; right: 8px; top: 10px; }
  .mobile-workspace .subtitle-secondary, .mobile-workspace .hero-book-icon,
  .mobile-workspace .m-header-actions, .mobile-workspace #sovereign-orb,
  .mobile-workspace #sovereign-panel, .mobile-workspace #sovereign-toast,
  .mobile-workspace #sovereign-suggestion-bar, .mobile-workspace .af-first-arrow,
  .mobile-workspace #afCoach { display: none !important; }
  .mobile-workspace > .hf-launcher { position: relative; top: auto; flex: 0 0 auto; padding: 2px 6px; }
  .mobile-workspace .hf-launcher #hfStatus { font-size: 10px; }
  .mobile-workspace > .bake-wrapper, .mobile-workspace > .main-layout {
    flex: 1 1 0; min-height: 0 !important; height: auto !important; width: 100%; max-width: none;
    margin: 0 !important; padding: 0 !important; border: 0; border-radius: 0; box-shadow: none;
    display: flex !important; flex-direction: column; overflow: hidden;
  }
  .mobile-workspace .bake-wrapper > .main-layout {
    display: flex !important; flex: 1 1 0; min-height: 0; overflow: hidden;
  }
  .mobile-workspace .fleet-main { width: 100%; flex: 1 1 0; min-height: 0; overflow: hidden; }
  .mobile-workspace .chat-scroll-area, .mobile-workspace .m-chat-area {
    flex: 1 1 0; height: auto !important; min-height: 0 !important;
    overflow-y: auto !important; overscroll-behavior: contain; padding: 12px !important;
    border: none !important; border-radius: 0; scroll-behavior: auto;
  }
  .mobile-workspace #chatMessages { overflow: visible; height: auto; max-height: none; padding: 0; }
  .mobile-workspace .mw-initial-message { display: none; }
  .mobile-workspace .message-content { max-width: 100% !important; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
  .mobile-workspace pre, .mobile-workspace table { max-width: 100%; overflow-x: auto; }
  .mobile-workspace .input-area, .mobile-workspace .m-input-bar {
    flex: 0 0 auto; display: flex; gap: 8px; margin: 0; padding: 8px 10px max(8px, env(safe-area-inset-bottom)) !important;
  }
  .mobile-workspace #messageInput { flex: 1; width: 0; min-width: 0; min-height: 44px; font-size: 16px !important; }
  .mobile-workspace #sendButton { min-width: 48px; min-height: 44px; flex-shrink: 0; }
  .mobile-workspace .af-indicator-wrap { flex-shrink: 0; padding: 3px 10px 0; }
  .mobile-workspace .af-indicator { min-height: 32px; display: inline-flex; align-items: center; }
  .mobile-workspace .af-prompt-bubble { flex-shrink: 0; max-height: 26vh; overflow-y: auto; margin: 4px 10px; padding: 8px; }
  .mobile-workspace #omni-report-bar { flex-shrink: 0; max-height: 72px; overflow-y: auto; }
  .mobile-workspace [aria-label="Health & safety notice"] { padding: 8px !important; font: 400 12px/1.4 system-ui, sans-serif !important; margin-bottom: 12px; border-radius: 6px; }
  .mobile-workspace [aria-label="Health & safety notice"] > div { padding: 0 !important; gap: 4px !important; }
  .mobile-workspace.mw-keyboard .mw-intro, .mobile-workspace.mw-keyboard .subtitle,
  .mobile-workspace.mw-keyboard .m-subtitle { display: none; }
  .mobile-workspace.mw-keyboard .rat-hero-inner, .mobile-workspace.mw-keyboard .m-header-left { min-height: 52px; }
}