/* Scoped layout law for the chat controls and their native top-layer popouts. */
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] > .window-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] > .window-bar > span {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] > .window-bar > div {
  display: flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
}
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] .communion-zone {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  min-height: 0 !important;
}
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] .chat-shell {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
html body[data-launch][data-device-profile] .chat-window[data-workspace-mounted] .chat-head {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 6px 8px !important;
  flex: 0 0 auto !important;
}
html body[data-launch][data-device-profile] .chat-window .chat-workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
html body[data-launch][data-device-profile] .chat-window .chat-workspace-toolbar .altar {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex: 1 1 0 !important;
  gap: 8px !important;
  min-width: 0 !important;
  min-height: 40px !important;
  height: 40px !important;
  max-height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar :is(.field-grid, .state-chip, .altar-telemetry, .ring, .orb-glow),
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar::before,
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar::after { display: none !important; }
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar :is(.orb-stage, .emoji-sigil) {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 26px !important;
  transform: none !important;
  margin: 0 !important;
}
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar .entity-identity {
  position: static !important;
  min-width: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  transform: none !important;
  border: 0 !important;
  background: none !important;
}
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar .entity-identity :is(h1, p) {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}
html body[data-launch][data-device-profile] .chat-workspace-toolbar .altar .entity-identity p { font-size: 9px !important; }
html body[data-launch][data-device-profile] .chat-window .chat-popout-trigger,
html body[data-launch][data-device-profile] .chat-popout-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #edf3f2;
  cursor: pointer;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout-trigger:hover,
html body[data-launch][data-device-profile] .chat-window .chat-popout-trigger[aria-expanded="true"],
html body[data-launch][data-device-profile] .chat-popout-bar button:hover { background: #26312f; border-color: #5e7770; }
html body[data-launch][data-device-profile] .chat-window .chat-popout-trigger:focus-visible,
html body[data-launch][data-device-profile] .chat-popout :is(button, input, select):focus-visible { outline: 2px solid #9af6d0; outline-offset: 2px; }
html body[data-launch][data-device-profile] .chat-window :is(.chat-popout-trigger, .chat-popout-bar) img { filter: invert(1); flex: 0 0 18px; }
html body[data-launch][data-device-profile] .chat-window .chat-objective-summary {
  flex: 0 0 auto;
  width: 100%;
  height: 38px;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  color: #e1d5a5;
  border-top: 1px solid #3c4240;
  border-radius: 0;
}
.chat-objective-summary > span { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.chat-objective-summary small { font-size: 9px; letter-spacing: 0; flex-shrink: 0; }
.chat-objective-summary b { font-size: 11px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body[data-launch][data-device-profile] .chat-window .chat-popout {
  position: fixed !important;
  inset: auto;
  margin: 0 !important;
  padding: 12px !important;
  box-sizing: border-box;
  overflow: auto !important;
  overscroll-behavior: contain;
  border: 1px solid #69776f !important;
  border-radius: 8px !important;
  background: #111916 !important;
  color: #edf3f2 !important;
  box-shadow: 0 16px 48px #0009 !important;
  font: 13px/1.5 var(--font-mono, monospace);
  letter-spacing: 0 !important;
}
html body[data-launch][data-device-profile] .chat-popout:not(:popover-open) { display: none !important; }
html body[data-launch][data-device-profile] .chat-popout::backdrop { background: transparent; }
.chat-popout-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
html body[data-launch][data-device-profile] .chat-popout-bar strong { font-size: 14px; letter-spacing: 0; }
html body[data-launch][data-device-profile] .chat-window .chat-popout :is(.chat-control-row, .chat-tools, .continuity-controls, .chat-popout-actions) {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 0 12px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout .chat-control-row { grid-template-columns: 1fr !important; }
html body[data-launch][data-device-profile] .chat-window .chat-popout :is(button, select, input) {
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 40px !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  font-size: 12px !important;
  letter-spacing: 0 !important;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout :is(select, input) { width: 100%; box-sizing: border-box; }
html body[data-launch][data-device-profile] .chat-window .chat-popout button:not(.chat-popout-bar button) {
  padding: 8px 10px !important;
  border: 1px solid #4d6257;
  border-radius: 4px;
  background: #1e2b25;
  color: #edf3f2;
  cursor: pointer;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout button:disabled { opacity: .5; cursor: default; }
html body[data-launch][data-device-profile] .chat-window .chat-popout [hidden] { display: none !important; }
html body[data-launch][data-device-profile] .chat-window .chat-popout .continuity-controls span {
  grid-column: 1 / -1;
  width: auto !important;
  max-width: none !important;
  white-space: normal !important;
  font-size: 12px !important;
  overflow: visible !important;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout #ghost-wake-strip {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  padding: 0 !important;
}
html body[data-launch][data-device-profile] .chat-window .chat-popout :is(#ghost-wake-strip, #record-mode-panel) > div { display: none !important; }
html body[data-launch][data-device-profile] .chat-window .chat-popout #objective-spine {
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}
html body[data-launch][data-device-profile] .chat-popout #objective-spine :is(b, span, em, i) {
  color: #cbdad1 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
html body[data-launch][data-device-profile] .chat-popout #objective-spine .gate-progress { display: none !important; }
.chat-popout .objective-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.chat-popout .objective-editor label { display: grid; gap: 4px; margin: 8px 0; }
.chat-objective-details { border-top: 1px solid #3c4240; margin-top: 12px; padding-top: 8px; }
.chat-objective-details ul { padding-left: 18px; margin: 6px 0 12px; }
.chat-objective-details li { overflow-wrap: anywhere; }
html body[data-device-profile="phone"] .chat-window[data-workspace-mounted] .chat-stream { min-height: 0 !important; }
