/* Ask home only. Loaded last, unlayered, so these rules beat the
   layered legacy sheets (including @layer screens) without !important.
   Every selector is scoped to body.route-ask. Other routes are untouched.

   A short legacy-n-base block at the bottom beats phone-OS !important
   that tests pin in mobile-os.css (fixed composer, pill radius, borders).
   Those declarations cannot be deleted. Weights are Satoshi 400 / 500 / 700.
   #2196F3 is the send button only. */

html body.route-ask {
  --ask-canvas: #171818;
  --ask-page: #1A1B1B;
  --ask-card: #1F2121;
  --ask-raised: #252727;
  --ask-hover: #2B2D2D;
  --ask-border: #2F3232;
  --ask-border-strong: #3B3E3E;
  --ask-text: #ECEDEC;
  --ask-text-2: #A6ABAB;
  --ask-text-3: #7A7F7F;
  --ask-accent: #2196F3;
  background: var(--ask-page);
  color: var(--ask-text);
}

html body.route-ask #main,
html body.route-ask #main-content,
html body.route-ask .main-content,
html body.route-ask .ai-view {
  background: var(--ask-page);
  color: var(--ask-text);
}

/* Sidebar on this route only: active row is a neutral fill, plan label
   is plain tertiary text. Other routes keep their own sidebar. */
html body.route-ask aside.sidebar#sidebar .sidebar-quick-item.active {
  background: var(--ask-hover);
  background-image: none;
  color: var(--ask-text);
  box-shadow: none;
}

html body.route-ask aside.sidebar#sidebar .sidebar-quick-item.active .sqi-icon,
html body.route-ask aside.sidebar#sidebar .sidebar-quick-item.active .sqi-label {
  background: transparent;
  background-image: none;
  color: var(--ask-text);
  font-weight: 500;
}

html body.route-ask .footer-org-tier-badge {
  background: transparent;
  background-image: none;
  color: var(--ask-text-3);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Session tabs: rounded pills. #219 flattened these to plain text.
   The earlier charcoal pills (cursor-tabs.css, border-radius 999px)
   come back inside this palette: 1px #2F3232, active on #252727. */
html body.route-ask.ty-has-agent-tabs header.topbar#topbar,
html body.route-ask.ty-has-agent-tabs header.topbar.topbar--no-header {
  background: var(--ask-page);
  background-color: var(--ask-page);
  background-image: none;
  border: 0;
  border-bottom: 0;
  box-shadow: none;
  padding: 8px 12px;
  min-height: 48px;
}

html body.route-ask #ty-agent-tabs.ty-agent-tabs,
html body.route-ask header.topbar #ty-agent-tabs.ty-tabs-bar.ty-agent-tabs {
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  min-height: 36px;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

html body.route-ask #ty-agent-tabs .ty-session-scroller {
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  align-items: center;
}

html body.route-ask #ty-agent-tabs .ty-tab {
  height: 32px;
  min-height: 32px;
  max-width: min(56vw, 240px);
  padding: 0 14px;
  border: 1px solid var(--ask-border);
  border-radius: 999px;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--ask-text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

html body.route-ask #ty-agent-tabs .ty-tab:hover {
  background: var(--ask-hover);
  border-color: var(--ask-border);
  color: var(--ask-text);
}

html body.route-ask #ty-agent-tabs .ty-tab.is-active {
  background: var(--ask-raised);
  border-color: var(--ask-border);
  color: var(--ask-text);
  font-weight: 500;
}

html body.route-ask #ty-agent-tabs .ty-tab:focus {
  outline: none;
}

html body.route-ask #ty-agent-tabs .ty-tab:focus-visible,
html body.route-ask #ty-agent-tabs .ty-tab-add:focus-visible {
  outline: 1px solid var(--ask-border-strong);
  outline-offset: 2px;
}

html body.route-ask #ty-agent-tabs .ty-tab-label {
  font-size: 14px;
  font-weight: 500;
}

html body.route-ask #ty-agent-tabs .ty-tab-add {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0 0 0 8px;
  padding: 0;
  border: 1px solid var(--ask-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ask-text-2);
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
}

html body.route-ask #ty-agent-tabs .ty-tab-add:hover {
  background: var(--ask-hover);
  border-color: var(--ask-border);
  color: var(--ask-text);
}

html body.route-ask #ty-agent-tabs .ty-tab-add:focus {
  outline: none;
}

/* Empty state. The wordmark and its shimmer stay out of the column.
   The composer sits about 40% down. Checked questions and the KPI
   actions are one list of text rows under it. */
html body.route-ask .ai-bg-mark,
html body.route-ask .ai-bg-mark__shimmer {
  display: none;
}

html body.route-ask:not(.ai-has-messages) .ai-view > .ai-hero {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ai-view.ai-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  gap: 0;
  overflow-x: clip;
  overflow-y: auto;
}

html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ai-view > .ai-messages:empty {
  display: none;
  height: 0;
  margin: 0;
  padding: 0;
}

html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ai-composer-wrap {
  order: 1;
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: min(640px, 100%);
  max-width: 640px;
  margin: max(12px, calc(40vh - 48px)) auto 0;
  padding: 0;
  transform: none;
  background: transparent;
  background-image: none;
  border: 0;
  box-shadow: none;
  z-index: 2;
}

html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ask-examples {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(640px, 100%);
  max-width: 100%;
  margin: 8px 0 0;
  padding: 0;
  text-align: left;
}

html body.route-ask .ask-examples-title {
  display: none;
}

html body.route-ask .ask-examples-row,
html body.route-ask .chat-suggest-row.ask-examples-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

html[data-tenant-kpi="1"] body.route-ask:not(.ai-has-messages):not(.kpi-active) #kpi-pills-row,
html[data-tenant-kpi="1"] body.route-ask:not(.ai-has-messages):not(.kpi-active) .kpi-pills-row {
  order: 3;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: min(640px, 100%);
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html body.route-ask .ask-example-chip,
html body.route-ask:not(.kpi-active) #kpi-pills-row .kpi-pill {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--ask-text-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}

html body.route-ask .ask-example-chip::after,
html body.route-ask:not(.kpi-active) #kpi-pills-row .kpi-pill::after {
  content: "\2192";
  margin-left: auto;
  color: var(--ask-text-3);
  font-size: 14px;
  font-weight: 400;
}

html body.route-ask:not(.kpi-active) #kpi-pills-row .kpi-pill__icon {
  display: none;
}

html body.route-ask .ask-example-chip:hover,
html body.route-ask:not(.kpi-active) #kpi-pills-row .kpi-pill:hover {
  background: var(--ask-hover);
  border: 0;
  color: var(--ask-text);
  transform: none;
}

/* One calm card. Model and Delegator are quiet text chips.
   Selectors are heavy so they beat style.css chrome pills
   (border, native appearance, and the blue focus outline). */
html body.route-ask .ai-view #ask-composer.rich-composer,
html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  background: var(--ask-card);
  background-color: var(--ask-card);
  background-image: none;
  border: 1px solid var(--ask-border);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 12px 12px 8px;
  color: var(--ask-text);
}

html body.route-ask .ai-view #ask-composer.rich-composer:focus-within {
  border-color: var(--ask-border);
  box-shadow: none;
  outline: none;
}

/* The phone sheet draws a second pill behind the input with ::before.
   The composer card is the only border. */
html body.route-ask .ai-view #ask-composer.rich-composer::before,
html body.route-ask .ai-view #ask-composer.rich-composer::after {
  content: none;
  display: none;
  border: 0;
  background: none;
  box-shadow: none;
}

html body.route-ask #ask-composer .rc-input,
html body.route-ask #ask-composer .rc-textarea {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ask-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  min-height: 24px;
}

html body.route-ask #ask-composer .rc-input:empty::before {
  color: var(--ask-text-3);
  font-weight: 400;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip, .rc-chip--model, .rc-mic, .gl-stop-btn, .rc-mode, .rc-mode-select) {
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  outline: none;
  color: var(--ask-text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-chip.rc-chip--model {
  display: inline-flex;
  align-items: center;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  width: auto;
  max-width: none;
  padding: 0 8px;
  gap: 6px;
  overflow: visible;
  color: var(--ask-text-2);
}

html body.route-ask #ask-composer .rc-chip--model .rc-chip-label,
html body.route-ask #ask-composer .rc-chip-caret {
  color: var(--ask-text-2);
  font-size: 13px;
  font-weight: 500;
}

html body.route-ask #ask-composer .rc-mode {
  position: static;
  display: flex;
  align-items: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-mode-select {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  width: auto;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0 20px 0 8px;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23A6ABAB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4.5 6 7.5 9 4.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 12px 12px;
  box-shadow: none;
  outline: none;
  color: var(--ask-text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  cursor: pointer;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip[data-chip="web"], .rc-mic) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0;
  border-radius: 999px;
  color: var(--ask-text-3);
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-chip[data-chip="web"].rc-chip--active {
  background: var(--ask-hover);
  color: var(--ask-text);
  border: 0;
  box-shadow: none;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip, .rc-chip--model, .rc-mic, .rc-mode-select):hover {
  background-color: var(--ask-hover);
  color: var(--ask-text);
  border: 0;
  box-shadow: none;
  outline: none;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip, .rc-chip--model, .rc-mic, .rc-mode-select, .rc-send):focus {
  outline: none;
  box-shadow: none;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip, .rc-chip--model, .rc-mic, .rc-mode-select, .rc-send):focus-visible {
  outline: 1px solid var(--ask-border-strong);
  outline-offset: 2px;
  box-shadow: none;
}

html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-send {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 10px;
  background: #2196F3;
  background-color: #2196F3;
  background-image: none;
  box-shadow: none;
  color: #fff;
}

html body.route-ask .ai-view #ask-composer.rich-composer .rc-attachments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  order: 0;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 8px;
  box-sizing: border-box;
}

html body.route-ask .ai-view #ask-composer.rich-composer .rc-attachments:empty {
  display: none;
  margin: 0;
}

html body.route-ask .ai-view #ask-composer.rich-composer .rc-file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  height: 28px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--ask-border);
  border-radius: 6px;
  background: var(--ask-raised);
  background-image: none;
  box-shadow: none;
  color: var(--ask-text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body.route-ask .ai-view #ask-composer.rich-composer :is(.rc-attachments, .rc-input, .rc-textarea) img {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 48px;
  max-height: 48px;
  margin: 0;
  object-fit: cover;
  border: 1px solid var(--ask-border);
  border-radius: 6px;
  background: var(--ask-raised);
  box-shadow: none;
}

html body.route-ask .ai-view #ask-composer.rich-composer .ty-attach-thumb,
html body.route-ask .ty-bubble-photo {
  width: 96px;
  height: 96px;
  border: 1px solid var(--ask-border);
  border-radius: 10px;
  background: var(--ask-raised);
  background-image: none;
  box-shadow: none;
}

html body.route-ask .ty-bubble-photo {
  width: 168px;
  height: 168px;
}

html body.route-ask .ai-view #ask-composer.rich-composer .ty-attach-thumb img,
html body.route-ask .ty-bubble-photo img,
html body #floating-chat-composer .ty-attach-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  background: var(--ask-raised);
  box-shadow: none;
}

html body.route-ask #ask-composer .rc-send:hover,
html body.route-ask #ask-composer .rc-send:focus,
html body.route-ask #ask-composer .rc-send:active {
  background: var(--ask-accent);
  background-color: var(--ask-accent);
  box-shadow: none;
  transform: none;
  filter: none;
}

html body.route-ask #ask-composer .rc-send svg,
html body.route-ask #ask-composer .rc-send svg * {
  stroke: #fff;
  color: #fff;
  fill: none;
}

/* Thread follow-ups use the same text row, not a pill. */
html body.route-ask .nx-followup-chip {
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--ask-text-2);
  font-size: 14px;
  font-weight: 400;
}

html body.route-ask .nx-followup-chip:hover {
  background: var(--ask-hover);
  border: 0;
  color: var(--ask-text);
}

@media (max-width: 820px) {
  html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ask-example-chip,
  html body.route-ask:not(.ai-has-messages):not(.kpi-active) #kpi-pills-row .kpi-pill,
  html body.route-ask #ty-agent-tabs .ty-tab,
  html body.route-ask #ty-agent-tabs .ty-tab-add {
    min-height: 44px;
    height: 44px;
  }

  html body.route-ask #ty-agent-tabs .ty-tab-add {
    width: 44px;
    min-width: 44px;
  }

  html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-mode-select {
    width: auto;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    font-size: 16px;
    line-height: 44px;
    text-align: left;
  }

  html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native .rc-chip.rc-chip--model {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
  }

  html body.route-ask .ai-view #ask-composer.rich-composer.rc-controls-native :is(.rc-plus-native-wrap, .rc-chip[data-chip="web"], .rc-mic, .rc-send) {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
  }

  html body.route-ask.ai-has-messages .ai-composer-wrap {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

/* legacy-n-base is the first layer, so !important here beats the phone-OS
   !important that pins the composer and paints pill borders. Empty Ask
   only. Threads stay pinned by mobile-os.css. */
@layer legacy-n-base {
  @media (max-width: 820px) {
    html body.route-ask:not(.ai-has-messages):not(.kpi-active) .ai-composer-wrap {
      position: relative !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      width: min(640px, 100%) !important;
      max-width: 640px !important;
      margin: max(12px, calc(40vh - 100px - env(safe-area-inset-bottom, 0px))) auto 0 !important;
      transform: none !important;
    }

    html body.route-ask .ai-view #ask-composer.rich-composer :is(.rc-plus-native-wrap, .rc-chip:not(.rc-chip--model), .rc-mic, .gl-stop-btn) {
      border: 0 !important;
      border-radius: 999px !important;
      background: transparent !important;
      background-color: transparent !important;
      box-shadow: none !important;
      outline: none !important;
    }

    html body.route-ask .ai-view #ask-composer.rich-composer .rc-chip.rc-chip--model,
    html body.route-ask .ai-view #ask-composer.rich-composer .rc-mode,
    html body.route-ask .ai-view #ask-composer.rich-composer .rc-mode-select {
      border: 0 !important;
      border-radius: 999px !important;
      background-color: transparent !important;
      box-shadow: none !important;
      outline: none !important;
    }

    html body.route-ask .ai-view #ask-composer.rich-composer :is(.rc-chip, .rc-mode-select, .rc-plus-native-wrap, .rc-mic):focus {
      outline: none !important;
      box-shadow: none !important;
    }

    html body.route-ask .ai-view #ask-composer.rich-composer :is(.rc-chip, .rc-mode-select, .rc-plus-native-wrap, .rc-mic):focus-visible {
      outline: 1px solid #3B3E3E !important;
      outline-offset: 2px !important;
    }

    html body.route-ask .ai-view #ask-composer .rc-send {
      background: #2196F3 !important;
      background-color: #2196F3 !important;
      border: 0 !important;
      border-radius: 10px !important;
      box-shadow: none !important;
      color: #fff !important;
    }
  }
}

/* Side Ask rail. Unlayered rules above stay on the Ask page.
   These live in the first layer so they beat the floating-panel
   !important in desktop-v2, ask-chrome, and mobile-os. The open
   panel docks: #main loses the rail width and charts reflow.
   #2196F3 is the send button only. */
@layer legacy-n-base {
  html body .floating-chat .floating-chat-messages:empty::before {
    content: none !important;
    display: none !important;
  }

  html body .floating-chat .chat-empty,
  html body .floating-chat .chat-suggest-row,
  html body .floating-chat .chat-suggest-chip,
  html body .floating-chat [data-gl-empty] {
    display: none !important;
  }

  @media (min-width: 821px) {
    html body.ask-rail-open #main,
    html body:has(#floating-chat.open) #main {
      margin-right: 420px !important;
      width: auto !important;
      max-width: none !important;
      min-width: 0 !important;
      flex: 1 1 auto !important;
      box-sizing: border-box !important;
    }

    html body.ask-rail-open #main-content,
    html body:has(#floating-chat.open) #main-content,
    html body.ask-rail-open #main-content > *,
    html body:has(#floating-chat.open) #main-content > * {
      min-width: 0 !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }

    html body .floating-chat.open .floating-chat-panel {
      position: fixed !important;
      top: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      left: auto !important;
      width: 420px !important;
      max-width: 420px !important;
      height: 100dvh !important;
      max-height: none !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      border-left: 1px solid #2F3232 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background: #1A1B1B !important;
      background-color: #1A1B1B !important;
      background-image: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      transform: none !important;
      opacity: 1 !important;
      box-sizing: border-box !important;
      overflow: hidden !important;
      display: flex !important;
      flex-direction: column !important;
      z-index: 1200 !important;
    }
  }

  /* Remaining pane is tight once the 420px rail is docked. Stack cards
     so a chart is not sliced by the rail. */
  @media (min-width: 821px) and (max-width: 1200px) {
    html body.ask-rail-open.route-superviz .sv-page .sv-grid,
    html body:has(#floating-chat.open).route-superviz .sv-page .sv-grid {
      grid-template-columns: minmax(0, 1fr) !important;
    }

    html body.ask-rail-open.route-superviz .sv-page .sv-card,
    html body:has(#floating-chat.open).route-superviz .sv-page .sv-card {
      grid-column: 1 / -1 !important;
      min-width: 0 !important;
      max-width: 100% !important;
    }

    html body.ask-rail-open.route-superviz .sv-page .sv-tabs,
    html body:has(#floating-chat.open).route-superviz .sv-page .sv-tabs {
      flex-wrap: wrap !important;
      overflow: visible !important;
    }
  }

  html body.ask-rail-open.route-superviz .sv-page,
  html body:has(#floating-chat.open).route-superviz .sv-page,
  html body.ask-rail-open.route-superviz .sv-page .sv-grid,
  html body:has(#floating-chat.open).route-superviz .sv-page .sv-grid,
  html body.ask-rail-open.route-superviz .sv-page .sv-card,
  html body:has(#floating-chat.open).route-superviz .sv-page .sv-card {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .floating-chat.open .floating-chat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex: 0 0 auto !important;
    gap: 8px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-bottom: 1px solid #2F3232 !important;
    box-shadow: none !important;
  }

  html body .floating-chat.open .floating-chat-header .panel-title {
    font-family: "Satoshi", system-ui, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    color: #ECEDEC !important;
  }

  html body .floating-chat.open .floating-chat-header .btn-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #A6ABAB !important;
  }

  html body .floating-chat.open .floating-chat-header .btn-close:hover {
    background: #2B2D2D !important;
    color: #ECEDEC !important;
  }

  html body .floating-chat.open .floating-chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: transparent !important;
  }

  html body .floating-chat .floating-chat-composer,
  html body .floating-chat .floating-chat-composer.glass-composer {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 12px 12px !important;
    box-sizing: border-box !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html body #floating-chat-composer.rich-composer,
  html body #floating-chat-composer.rich-composer.rc-controls-native {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px 10px 8px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    background: #1F2121 !important;
    background-color: #1F2121 !important;
    background-image: none !important;
    border: 1px solid #2F3232 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: #ECEDEC !important;
    overflow: hidden !important;
  }

  html body #floating-chat-composer.rich-composer::before,
  html body #floating-chat-composer.rich-composer::after,
  html body #floating-chat-composer.rich-composer:focus-within {
    content: none !important;
    border-color: #2F3232 !important;
    box-shadow: none !important;
    outline: none !important;
    filter: none !important;
  }

  html body #floating-chat-composer .rc-input,
  html body #floating-chat-composer .rc-textarea {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 24px !important;
    max-height: 120px !important;
    margin: 0 !important;
    padding: 2px 2px 6px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    color: #ECEDEC !important;
    font-family: "Satoshi", system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
  }

  html body #floating-chat-composer .rc-input:empty::before {
    content: attr(data-placeholder) !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    right: 2px !important;
    display: block !important;
    color: #7A7F7F !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  html body #floating-chat-composer .rc-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    transform: none !important;
  }

  html body #floating-chat-composer .rc-left {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html body #floating-chat-composer .rc-right,
  html body #floating-chat-composer .rc-send-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    gap: 6px !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  html body #floating-chat-composer .rc-chip[data-chip="web"] {
    display: none !important;
  }

  html body #floating-chat-composer :is(.rc-plus-btn, .rc-plus-menu) {
    display: none !important;
  }

  html body #floating-chat-composer :is(.rc-plus-wrap, .rc-plus-native-wrap, .rc-mic, .gl-stop-btn) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #A6ABAB !important;
    aspect-ratio: auto !important;
  }

  html body #floating-chat-composer .rc-plus-native {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    opacity: 0 !important;
  }

  html body #floating-chat-composer .rc-plus-native-wrap {
    position: relative !important;
  }

  html body #floating-chat-composer :is(.rc-plus-native-wrap, .rc-mic, .gl-stop-btn) svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex: 0 0 16px !important;
    stroke: currentColor !important;
    color: inherit !important;
    fill: none !important;
  }

  html body #floating-chat-composer .rc-chip.rc-chip--model {
    display: inline-flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 148px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #A6ABAB !important;
    font-family: "Satoshi", system-ui, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
  }

  html body #floating-chat-composer .rc-chip--model .rc-chip-label {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #A6ABAB !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: 0 !important;
  }

  html body #floating-chat-composer .rc-chip--model .rc-chip-caret {
    flex: 0 0 12px !important;
    width: 12px !important;
    height: 12px !important;
    color: #7A7F7F !important;
    opacity: 1 !important;
  }

  html body #floating-chat-composer .rc-mode {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    flex: 0 1 112px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 112px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: auto !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body #floating-chat-composer .rc-mode-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 18px 0 8px !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 999px !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%237A7F7F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 4.5 6 7.5 9 4.5'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    background-size: 12px 12px !important;
    box-shadow: none !important;
    outline: none !important;
    color: #A6ABAB !important;
    font-family: "Satoshi", system-ui, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 32px !important;
    cursor: pointer !important;
    text-overflow: ellipsis !important;
  }

  html body #floating-chat-composer :is(.rc-plus-native-wrap, .rc-chip--model, .rc-mode-select, .rc-mic):hover {
    background-color: #2B2D2D !important;
    color: #ECEDEC !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body #floating-chat-composer :is(.rc-plus-native-wrap, .rc-chip--model, .rc-mode-select, .rc-mic, .rc-send):focus,
  html body #floating-chat-composer :is(.rc-plus-native-wrap, .rc-chip--model, .rc-mode-select, .rc-mic, .rc-send):focus-visible {
    outline: 1px solid #3B3E3E !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
  }

  html body #floating-chat-composer .rc-send {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #2196F3 !important;
    background-color: #2196F3 !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    color: #fff !important;
    aspect-ratio: auto !important;
  }

  html body #floating-chat-composer .rc-send:hover,
  html body #floating-chat-composer .rc-send:focus,
  html body #floating-chat-composer .rc-send:active {
    background: #2196F3 !important;
    background-color: #2196F3 !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  html body #floating-chat-composer .rc-send svg,
  html body #floating-chat-composer .rc-send svg * {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    stroke: #fff !important;
    color: #fff !important;
    fill: none !important;
  }

  html body #floating-chat-composer .rc-attachments {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    order: 0 !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html body #floating-chat-composer .ty-attach-thumb {
    width: 96px !important;
    height: 96px !important;
    max-width: 96px !important;
    border: 1px solid #2F3232 !important;
    border-radius: 10px !important;
    background: #252727 !important;
    background-image: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  html body #floating-chat-composer .rc-attachments:empty {
    display: none !important;
  }

  @media (max-width: 820px) {
    html body.ask-rail-open #main,
    html body:has(#floating-chat.open) #main {
      flex: 0 0 0 !important;
      width: 0 !important;
      max-width: 0 !important;
      min-width: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
    }

    html body #floating-chat.open,
    html body.route-superviz #floating-chat.open,
    html body.route-chats #floating-chat.open,
    html body.kb-open #floating-chat.open,
    html body.route-ask.ai-has-messages #floating-chat.open {
      display: flex !important;
      position: fixed !important;
      inset: 0 !important;
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      z-index: 1400 !important;
      pointer-events: none !important;
    }

    html body #floating-chat.open .floating-chat-panel {
      display: flex !important;
      position: relative !important;
      inset: auto !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      flex: 1 1 auto !important;
      width: 100% !important;
      max-width: 100% !important;
      height: 100% !important;
      max-height: none !important;
      margin: 0 !important;
      border: 0 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      background: #1A1B1B !important;
      background-image: none !important;
      transform: none !important;
      pointer-events: auto !important;
      overflow: hidden !important;
      box-sizing: border-box !important;
    }

    html body .floating-chat .floating-chat-composer,
    html body .floating-chat .floating-chat-composer.glass-composer {
      padding: 0 max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)) !important;
    }

    html body .floating-chat.open .floating-chat-header {
      padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    }

    html body .floating-chat.open .floating-chat-header .btn-close,
    html body #floating-chat-composer :is(.rc-plus-wrap, .rc-plus-native-wrap, .rc-mic, .gl-stop-btn, .rc-send) {
      width: 44px !important;
      height: 44px !important;
      min-width: 44px !important;
      max-width: 44px !important;
      min-height: 44px !important;
      max-height: 44px !important;
      flex: 0 0 44px !important;
    }

    html body #floating-chat-composer .rc-plus-native {
      min-width: 44px !important;
      height: 44px !important;
      min-height: 44px !important;
    }

    html body #floating-chat-composer .rc-toolbar {
      flex-wrap: wrap !important;
      align-content: flex-start !important;
      height: auto !important;
      max-height: none !important;
      min-height: 0 !important;
      row-gap: 8px !important;
      overflow: visible !important;
    }

    html body #floating-chat-composer :is(.rc-left, .rc-right, .rc-send-actions) {
      display: contents !important;
    }

    html body #floating-chat-composer .rc-chip.rc-chip--model,
    html body #floating-chat-composer .rc-mode,
    html body #floating-chat-composer .rc-mode-select {
      min-height: 44px !important;
      height: 44px !important;
      max-height: 44px !important;
    }

    html body #floating-chat-composer .rc-chip.rc-chip--model {
      order: 1 !important;
      flex: 1 0 46% !important;
      width: auto !important;
      max-width: none !important;
    }

    html body #floating-chat-composer .rc-mode {
      order: 2 !important;
      flex: 1 0 46% !important;
      width: auto !important;
      max-width: none !important;
    }

    html body #floating-chat-composer .rc-plus-wrap {
      order: 3 !important;
    }

    html body #floating-chat-composer .rc-mic {
      order: 4 !important;
      margin-left: auto !important;
    }

    html body #floating-chat-composer .rc-send {
      order: 5 !important;
    }

    html body #floating-chat-composer .rc-input,
    html body #floating-chat-composer .rc-textarea,
    html body #floating-chat-composer .rc-input:empty::before,
    html body #floating-chat-composer .rc-mode-select {
      font-size: 16px !important;
    }

    html body #floating-chat-composer .rc-mode {
      flex: 1 0 46% !important;
      max-width: none !important;
    }

    html body #floating-chat-composer .rc-mode-select {
      line-height: 44px !important;
    }

    html body #floating-chat-composer .rc-chip.rc-chip--model {
      max-width: none !important;
    }
  }
}

/* Follow-ups sit on the answer, never on the empty panel.
   Flat 1px borders. No pills, tint, glow, or blur. */
html body.route-ask .ask-follow {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ask-border);
  font-family: Satoshi, sans-serif;
}

html body.route-ask .ask-how {
  border: 1px solid var(--ask-border);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

html body.route-ask .ask-how > summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--ask-text-2);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}

html body.route-ask .ask-how > ol {
  margin: 0;
  padding: 0 10px 10px 28px;
  color: var(--ask-text);
  font-size: 13px;
  line-height: 1.45;
}

html body.route-ask .ask-how li[data-state="running"] {
  color: var(--ask-text-2);
}

html body.route-ask .ask-insight {
  margin: 8px 0 0;
  color: var(--ask-text);
  font-size: 14px;
  line-height: 1.4;
}

html body.route-ask .ask-next,
html body.route-ask .ask-action {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--ask-border);
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--ask-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

html body.route-ask .ask-work {
  margin-top: 10px;
  border: 1px solid var(--ask-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html body.route-ask .ask-work-title {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ask-border);
  color: #2196F3;
  font-size: 13px;
  font-weight: 500;
}

html body.route-ask .ask-work-line,
html body.route-ask .ask-work-sql {
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--ask-border);
  color: var(--ask-text);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

html body.route-ask .ask-work table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

html body.route-ask .ask-work th,
html body.route-ask .ask-work td {
  border-top: 1px solid var(--ask-border);
  padding: 4px 10px;
  text-align: left;
  border-radius: 0;
}

html body.route-ask .ask-chart-preview {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--ask-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html body.route-ask .ask-chart-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

html body.route-ask .ask-chart-preview th,
html body.route-ask .ask-chart-preview td {
  border-bottom: 1px solid var(--ask-border);
  padding: 4px 6px;
  text-align: left;
  color: var(--ask-text);
}

html body.route-ask .ask-bar {
  height: 8px;
  margin-top: 4px;
  background: var(--ask-text-2);
  border-radius: 0;
}

html body.route-ask .ask-chart-save {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

html body.route-ask .ask-chart-save select,
html body.route-ask .ask-chart-save button {
  border: 1px solid var(--ask-border);
  border-radius: 0;
  background: transparent;
  color: var(--ask-text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  box-shadow: none;
}

html body.route-ask .gl-stop-btn::after {
  content: "Stop";
  margin-left: 6px;
  font-family: Satoshi, sans-serif;
  font-size: 13px;
  font-weight: 500;
}
