/* chat-viewport@1 — Intelligence = single full-page viewport chat
   Strip edit/retry + dense secondary chrome from main thread.
   Discrete tasks → optional pop-out. Applies to www + ?embed=1. */

html, body, #app {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

/* Full-bleed chat desk: collapse side rail */
.desk {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.chat-desk {
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr auto !important;
  height: 100%;
  min-height: 0;
}
.game-rail {
  display: none !important;
}

/* Slim chrome: keep brand + essential; hide dense nav clutter on chat focus */
.chrome {
  min-height: 44px;
  padding: 6px 12px;
}
.chrome .hint,
.desk > .hint {
  display: none !important;
}
.chrome-nav a:not([href="/"]):not([href="#/"]):not([href="#chat"]):not([data-route="chat"]) {
  /* keep links but compress — hide secondary routes when data-chat-focus */
}

html.chat-focus .chrome-nav,
body.chat-focus .chrome-nav {
  display: none !important;
}
html.chat-focus .chrome,
body.chat-focus .chrome {
  justify-content: space-between;
}

/* Main thread: messages + composer only */
.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 12px !important;
}
.composer-wrap {
  flex-shrink: 0;
}

/* Strip per-message edit/retry + dense secondary affordances */
button[data-control="edit-retry"],
.btn-ghost[data-control="edit-retry"],
article.msg .btn.btn-ghost {
  display: none !important;
}

/* Hide lattice hash / debug noise on main thread */
.thread .hash,
.thread .lede,
.composer-wrap > .lede:not([role="status"]) {
  display: none !important;
}
.thread .chip {
  opacity: 0.55;
  transform: scale(0.92);
  transform-origin: left center;
}
html.chat-focus .thread .chip,
body.chat-focus .thread .chip,
html.doom-embed .thread .chip,
body.doom-embed .thread .chip {
  display: none !important;
}

/* Hide learn-loop dock + geom atmosphere from main viewport (pop-out instead) */
html.chat-focus #hector-learn-loop,
body.chat-focus #hector-learn-loop {
  display: none !important;
}
html.chat-focus #hector-geom-atmosphere,
body.chat-focus #hector-geom-atmosphere {
  opacity: 0.25;
  pointer-events: none;
}

/* Embed mode: maximal chat-only */
html.doom-embed .chrome,
body.doom-embed .chrome,
html.doom-embed .game-rail,
body.doom-embed .game-rail,
html.doom-embed #doom-entrance,
body.doom-embed #doom-entrance,
html.doom-embed #doom-chrome-bridge,
body.doom-embed #doom-chrome-bridge,
html.doom-embed #hector-learn-loop,
body.doom-embed #hector-learn-loop,
html.doom-embed #hector-geom-atmosphere,
body.doom-embed #hector-geom-atmosphere,
html.doom-embed #hector-task-dock,
body.doom-embed #hector-task-dock {
  display: none !important;
}
html.doom-embed .desk,
body.doom-embed .desk {
  min-height: 100dvh;
}
html.doom-embed .chat-desk,
body.doom-embed .chat-desk {
  grid-template-columns: 1fr !important;
  height: 100dvh;
}
html.doom-embed .composer-wrap,
body.doom-embed .composer-wrap {
  background: rgb(0 12 36 / 0.72);
  border-top-color: rgb(0 71 171 / 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Task dock — pop-out affordances for discrete work */
#hector-task-dock {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 99970;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  max-width: min(420px, calc(100vw - 24px));
  background: rgb(0 12 36 / 0.55);
  border: 1px solid rgb(0 71 171 / 0.55);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.45);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
#hector-task-dock button,
#hector-task-dock a {
  appearance: none;
  border: none;
  background: transparent;
  color: #3d8cff;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
}
#hector-task-dock button:hover,
#hector-task-dock a:hover,
#hector-task-dock button:focus-visible,
#hector-task-dock a:focus-visible {
  color: #E1FF00;
  background: rgb(0 71 171 / 0.28);
  outline: none;
}

@media (max-width: 720px) {
  #hector-task-dock {
    left: 8px;
    right: 8px;
    max-width: none;
    border-radius: 14px;
  }
  .chat-desk {
    grid-template-columns: 1fr !important;
  }
}
