/* HAL GUI Milestone 1 — Build Focus Mode.
   Visual-only state driven by data-hal-work-focus. No execution authority. */

.hx-work-focus {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text, #f0f5ff);
}
.hx-work-focus[hidden] { display: none !important; }
.hx-work-focus-kicker {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--hx-blue, #70cfff) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--hx-blue, #70cfff) 10%, transparent);
  color: var(--hx-link, #84d3ff);
  font: 800 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .13em;
}
.hx-work-focus > strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#hx-work-focus-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #a6b6cf);
  font-size: 11px;
}
.hx-work-focus-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--divider-strong, #3a5174);
  border-radius: 9px;
  color: var(--hx-link, #84d3ff);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
.hx-work-focus-link:hover { background: var(--panel-3, #1b2942); }
.hx-work-focus-link:focus-visible {
  outline: 2px solid var(--hx-blue, #70cfff);
  outline-offset: 2px;
}

html[data-hal-work-focus="true"] #app .header {
  min-height: 56px;
  padding-block: 6px;
}
html[data-hal-work-focus="true"] .hx-headernav { display: none !important; }
html[data-hal-work-focus="true"] #app .product-ribbon {
  min-height: 44px;
  padding: 5px 18px;
  gap: 12px;
}
html[data-hal-work-focus="true"] #app .product-ribbon-copy { display: none !important; }
html[data-hal-work-focus="true"] #app .product-ribbon-actions {
  flex: 0 0 auto;
  gap: 6px;
}
html[data-hal-work-focus="true"] #app .product-ribbon-actions > :is(.avatar-main-launch, .radio-live-link) {
  display: none !important;
}
html[data-hal-work-focus="true"] #app .product-ribbon-actions :is(.hal-connect-trigger, .workspace-launch) {
  min-height: 34px;
  height: 34px;
  padding-block: 4px;
}
html[data-hal-work-focus="true"] #app .messages-wrap {
  padding-top: 14px;
  padding-bottom: 12px;
}
html[data-hal-work-focus="true"] #app .messages {
  --msg-col: min(1240px, 100%);
}
html[data-hal-work-focus="true"] #app .composer {
  padding-top: 7px;
}
html[data-hal-work-focus="true"] #app .composer-row {
  border-color: color-mix(in srgb, var(--hx-blue, #70cfff) 40%, var(--divider-strong, #3a5174));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hx-blue, #70cfff) 7%, transparent);
}
html[data-hal-work-focus="true"] #app .composer-row:focus-within {
  border-color: var(--hx-blue, #70cfff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hx-blue, #70cfff) 13%, transparent);
}
html[data-hal-work-focus="true"] #app .footer.footer-compact {
  min-height: 24px !important;
  padding-bottom: 2px !important;
}
html[data-hal-work-focus="true"] #app .footer-brand { opacity: .7; }

/* Belt-and-suspenders visual safety. JS also suspends the animation runtime. */
html[data-hal-work-focus="true"] :is(.hb-layer, .hb-key, .hb-menu, .hb-card, .hf-panel) {
  display: none !important;
}

@media (max-width: 900px) {
  html[data-hal-work-focus="true"] #app .header {
    min-height: 54px;
    padding-block: 5px;
  }
  html[data-hal-work-focus="true"] #app .product-ribbon {
    padding-inline: 12px;
  }
  html[data-hal-work-focus="true"] #hx-work-focus-meta { display: none; }
}
@media (max-width: 640px) {
  .hx-work-focus { gap: 6px; }
  .hx-work-focus-kicker { display: none; }
  .hx-work-focus > strong { font-size: 11px; }
  .hx-work-focus-link {
    width: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    color: transparent;
  }
  .hx-work-focus-link::after {
    content: "↗";
    color: var(--hx-link, #84d3ff);
    font-size: 14px;
  }
  html[data-hal-work-focus="true"] #app .product-ribbon-actions .hal-connect-trigger #hal-connect-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
@media (forced-colors: active) {
  .hx-work-focus-link, .hx-work-focus-kicker { border-color: CanvasText; }
  html[data-hal-work-focus="true"] #app .composer-row { border-color: Highlight; }
}


/* Milestone 2 — Smart Work Inspector affordance. Visual only. */
#workspace-open[data-work-inspector="active"] {
  border-color: color-mix(in srgb, var(--hx-blue, #70cfff) 58%, var(--divider-strong, #3a5174));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hx-blue, #70cfff) 12%, transparent), var(--e1);
}
#workspace-open[data-work-inspector="active"]::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--hx-blue, #70cfff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--hx-blue, #70cfff) 65%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  #workspace-open[data-work-inspector="active"]::before { box-shadow: none; }
}


/* Milestone 3 — Codex-style lifecycle rail + completion handoff. */
.hx-work-lifecycle {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 2px;
}
.hx-work-lifecycle-stage {
  position: relative;
  min-width: 0;
  padding: 7px 8px 7px 24px;
  border: 1px solid var(--divider, #263956);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel-2, #13223a) 82%, transparent);
  color: var(--muted, #a6b6cf);
  font: 800 10px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hx-work-lifecycle-stage::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 999px;
  background: var(--muted, #8393aa);
}
.hx-work-lifecycle-stage[data-state="done"] {
  border-color: color-mix(in srgb, var(--ok, #42d392) 44%, var(--divider, #263956));
  color: var(--text, #eef5ff);
}
.hx-work-lifecycle-stage[data-state="done"]::before { background: var(--ok, #42d392); }
.hx-work-lifecycle-stage[data-state="active"]::before {
  background: var(--hx-blue, #70cfff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--hx-blue, #70cfff) 62%, transparent);
}
.hx-work-lifecycle-stage[data-state="warn"] {
  border-color: color-mix(in srgb, var(--warn, #ffb454) 50%, var(--divider, #263956));
  color: var(--text, #eef5ff);
}
.hx-work-lifecycle-stage[data-state="warn"]::before { background: var(--warn, #ffb454); }

.hx-live-work-report {
  flex: 1 0 100%;
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--hx-blue, #70cfff) 32%, var(--divider, #263956));
  border-radius: 14px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel-2, #13223a) 94%, transparent),
      color-mix(in srgb, var(--panel, #0e182b) 98%, transparent));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04);
}
.hx-live-work-report > strong {
  font-size: 14px;
  letter-spacing: .01em;
}
.hx-live-work-report > p { margin: 0; }
.hx-live-work-report > b {
  margin-top: 2px;
  color: var(--muted, #a6b6cf);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hx-live-work-report ul {
  margin: -2px 0 2px 18px;
  padding: 0;
  color: var(--text, #eef5ff);
}
.hx-live-work-report li { margin: 3px 0; }
.hx-work-continue {
  justify-self: start;
  margin-top: 2px;
  border-color: color-mix(in srgb, var(--hx-blue, #70cfff) 50%, var(--divider-strong, #3a5174));
}

@media (max-width: 640px) {
  .hx-work-lifecycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-live-work-report { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-work-lifecycle-stage[data-state="active"]::before { box-shadow: none; }
}


/* Milestone 4 — explicit fresh-objective state after a terminal session. */
.hx-work-focus[data-new-task="true"] .hx-work-focus-kicker {
  border-color: color-mix(in srgb, var(--warn, #ffb454) 62%, transparent);
  background: color-mix(in srgb, var(--warn, #ffb454) 11%, transparent);
  color: var(--warn, #ffb454);
}
.hx-work-focus[data-new-task="true"] > strong {
  color: var(--text, #f0f5ff);
}
.hx-work-focus[data-new-task="true"] #hx-work-focus-meta {
  color: color-mix(in srgb, var(--warn, #ffb454) 78%, var(--muted, #a6b6cf));
}
