/* EYE · hud — top command bar, banners, menus, command palette. */

/* ─── Bar ─────────────────────────────────────────────────────────────────── */
.hud-bar {
  height: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 0 6px;
  min-width: 0;
}
.hud-cluster { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud-cluster--left { flex: 0 1 auto; }
.hud-cluster--mid { flex: 1 1 auto; justify-content: center; gap: 8px; overflow: hidden; }
.hud-cluster--right { flex: 0 0 auto; gap: 4px; }
.hud-rule { width: 1px; height: 22px; background: var(--line-2); flex: none; margin: 0 2px; }
.hud-caret { display: grid; place-items: center; color: var(--muted); flex: none; }
.hud-caret svg { width: 12px; height: 12px; }

/* Product mark */
.hud-brand {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 8px 0 6px; border-radius: var(--r-sm);
  color: var(--ink); flex: none;
  transition: background var(--t-fast);
}
.hud-brand:hover, .hud-brand[aria-expanded='true'] { background: var(--bg-3); }
.hud-brand__eye { display: grid; place-items: center; color: var(--blue); }
.hud-brand__eye svg { width: 19px; height: 19px; }
.hud-brand__word { font: 500 17px/1 var(--serif); letter-spacing: 0.28em; padding-left: 0.1em; }

/* Two-line fields: scenario, planner */
.hud-field {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  column-gap: 8px; align-items: center;
  height: 36px; padding: 0 8px; border-radius: var(--r-sm);
  text-align: left; min-width: 0;
  transition: background var(--t-fast);
}
.hud-field:hover, .hud-field[aria-expanded='true'] { background: var(--bg-3); }
.hud-field__label { grid-column: 1; font: 500 9.5px/1.1 var(--mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
.hud-field__value { grid-column: 1; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-md); color: var(--ink); line-height: 1.3; }
.hud-field .hud-caret { grid-column: 2; grid-row: 1 / span 2; }
.hud-scn { max-width: 330px; }
.hud-scn__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hud-scn__stale .dot { --tone: var(--amber-2); width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(227, 179, 65, 0.18); }
.hud-scn.is-busy { opacity: 0.75; }
.hud-planner { max-width: 260px; }
.hud-planner__label { font: 500 var(--fs-sm)/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-planner__run {
  font: 600 9px/1 var(--mono); letter-spacing: 0.06em; color: var(--amber-2);
  border: 1px solid rgba(227, 179, 65, 0.45); border-radius: 3px; padding: 2px 4px; white-space: nowrap;
}

/* RUN split button */
.hud-run { display: inline-flex; margin-left: 4px; flex: none; }
.hud-run__go { height: 32px; padding: 0 14px 0 11px; border-radius: var(--r-sm) 0 0 var(--r-sm); font-size: var(--fs-sm); letter-spacing: 0.1em; gap: 7px; }
.hud-run__go svg { width: 13px; height: 13px; }
.hud-run__more { height: 32px; width: 26px; padding: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 1px solid rgba(6, 16, 28, 0.35); }
.hud-run__more svg { width: 13px; height: 13px; }
.hud-run.is-busy .hud-run__go { background: var(--blue-a); border-color: rgba(88, 166, 255, 0.5); color: var(--blue-2); opacity: 1; cursor: progress; }
.hud-run.is-busy .hud-run__go .spinner { border-color: rgba(88, 166, 255, 0.25); border-top-color: var(--blue-2); }
.hud-run__go:disabled:not(.is-busy *) { opacity: 0.5; }

/* Job chips + mode badge */
.hud-jobs { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud-job {
  position: relative; overflow: hidden; cursor: pointer;
  height: 22px; padding: 0 9px; gap: 6px;
}
.hud-job:hover { filter: brightness(1.2); }
.hud-job__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--v, 0%); background: currentColor; opacity: 0.85; transition: width 0.4s var(--ease); }
.hud-job .spinner, .hud-mode .spinner { width: 10px; height: 10px; border-width: 1.5px; }
.hud-live {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
  box-shadow: 0 0 0 0 currentColor; animation: hud-live 1.6s ease-out infinite;
}
@keyframes hud-live { 0% { box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.6); } 100% { box-shadow: 0 0 0 7px rgba(88, 166, 255, 0); } }
.hud-lock { display: grid; place-items: center; width: 22px; height: 22px; color: var(--amber-2); }
.hud-mode {
  --tone: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 9px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--tone) 50%, transparent);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
  font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}
.hud-mode svg { width: 12px; height: 12px; }
.hud-mode.tone-neutral { --tone: var(--ink-2); }

/* Right cluster */
.hud-search {
  display: inline-flex; align-items: center; gap: 8px;
  width: 248px; height: 30px; padding: 0 6px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-1);
  color: var(--muted); font-size: var(--fs-sm); text-align: left;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.hud-search:hover { border-color: var(--line-strong); color: var(--ink-2); }
.hud-search__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-search__keys { display: inline-flex; gap: 3px; }
.hud-debrief { height: 30px; gap: 7px; position: relative; }
.hud-debrief[aria-pressed='true'] { background: var(--blue-a); border-color: rgba(88, 166, 255, 0.45); color: var(--blue-2); }
.hud-debrief__badge { margin-left: 1px; }
.hud-ibtn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm);
  color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast);
}
.hud-ibtn:hover, .hud-ibtn[aria-expanded='true'] { background: var(--bg-3); color: var(--ink); }
.hud-ibtn[aria-pressed='true'] { color: var(--blue-2); }
.hud-ibtn svg { width: 16px; height: 16px; }

/* ─── Banners (top-centre of the safe frame) ──────────────────────────────── */
.hud-banner {
  --tone: var(--blue);
  display: flex; align-items: center; gap: 10px;
  max-width: 100%; padding: 6px 6px 6px 11px;
  border-left: 3px solid var(--tone);
  font-size: var(--fs-sm); color: var(--ink-2);
  animation: eye-toast-in var(--t-med) var(--ease);
}
.hud-banner b { color: var(--ink); font-weight: 600; }
.hud-banner__ico { color: var(--tone); display: grid; place-items: center; flex: none; }
.hud-banner__text { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.hud-banner__act { flex: none; }
.hud-banner__x { flex: none; }
.hud-banner.tone-amber { --tone: var(--amber-2); }
.hud-banner.tone-red { --tone: var(--red); }
.hud-banner.tone-purple { --tone: var(--purple); }

/* ─── Popovers ────────────────────────────────────────────────────────────── */
.hud-pop { padding: 6px; }
.hud-pop__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 4px 8px; }
.hud-pop__sub { font-size: var(--fs-xs); color: var(--muted); }
.hud-mi__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hud-mi__main small { white-space: normal; line-height: 1.35; }
.menu__item[aria-disabled='true'] { opacity: 0.55; }
.menu__item .kbd { flex: none; }
.hud-why { color: var(--amber-2); }

/* Product menu with the suite grid */
.hud-product { width: 330px; display: flex; flex-direction: column; gap: 1px; }
.hud-suite { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px 2px 4px; }
.hud-suite__item {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: var(--r-sm);
  font: 500 10px/1.1 var(--mono); letter-spacing: 0.1em; color: var(--muted); text-decoration: none;
}
.hud-suite__item:hover, .hud-suite__item:focus-visible { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.hud-suite__item.is-current { color: var(--blue-2); background: var(--blue-a); }
.hud-suite__glyph { width: 12px; text-align: center; flex: none; font-family: var(--sans); }
.hud-suite__here { margin-left: auto; font-size: 8.5px; color: var(--blue); }

/* Scenario menu */
.hud-scnmenu { width: 420px; display: flex; flex-direction: column; }
.hud-scnmenu__head { display: flex; justify-content: space-between; }
.hud-scnmenu__list { max-height: min(52vh, 460px); display: flex; flex-direction: column; gap: 1px; padding-right: 2px; }
.hud-scnitem { align-items: flex-start; }
.hud-scnitem__check { width: 16px; flex: none; color: var(--blue-2); padding-top: 2px; }
.hud-scnitem__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hud-scnitem__name { color: var(--ink); font-weight: 500; }
.hud-scnitem.is-current .hud-scnitem__name { color: var(--blue-2); }
.hud-scnitem__desc {
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hud-scnitem .tag { flex: none; margin-top: 2px; }

/* Reset confirm */
.hud-confirm { width: 340px; padding: 6px; display: flex; flex-direction: column; gap: 10px; }
.hud-confirm__title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.hud-confirm__title svg { color: var(--amber-2); }
.hud-confirm__text { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.hud-confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Planner */
.hud-plan { width: 340px; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 10px; }
.hud-plan__algos > button { height: 28px; font-size: var(--fs-xs); }
.hud-plan__hint { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.hud-plan__hint b { color: var(--ink); font-weight: 600; }
.hud-plan__range { color: var(--faint); letter-spacing: 0; text-transform: none; }
.hud-plan .field { margin-bottom: 0; }
.hud-plan .stepper .input { width: 100%; }
.hud-plan .stepper { width: 100%; }
.hud-plan__seed { display: flex; gap: 6px; }
.hud-plan__seed .input { flex: 1; }
.hud-plan__caveat { display: flex; gap: 7px; align-items: flex-start; font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; border-top: 1px solid var(--line); padding-top: 9px; }
.hud-plan__caveat svg { color: var(--amber-2); flex: none; margin-top: 1px; }
.hud-plan__caveat b { color: var(--ink-2); }

/* Run menu */
.hud-runmenu { width: 300px; display: flex; flex-direction: column; gap: 1px; }
.hud-check__box {
  width: 15px; height: 15px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 3px; color: var(--blue-2);
}
.hud-check[aria-checked='true'] .hud-check__box { border-color: var(--blue); background: var(--blue-a); }

/* Batch / variance form, progress */
.hud-jobform { width: 330px; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 8px; }
.hud-jobform .field { margin-bottom: 0; }
.hud-jobform__calc { color: var(--ink-2); }
.hud-jobform__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.hud-prog { width: 300px; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 9px; }
.hud-prog__name { font-weight: 500; color: var(--ink); }
.hud-prog__actions { display: flex; justify-content: flex-end; gap: 6px; }

/* Export & help */
.hud-export { width: 320px; display: flex; flex-direction: column; gap: 1px; }
.hud-helpmenu { width: 290px; display: flex; flex-direction: column; gap: 1px; }

/* ─── Command palette ─────────────────────────────────────────────────────── */
.hud-pal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(2, 5, 9, 0.55);
  display: flex; justify-content: center; align-items: flex-start;
  padding: max(10vh, 64px) 16px 16px;
  animation: eye-fade var(--t-fast) var(--ease);
}
.hud-pal {
  width: min(640px, 100%); max-height: min(70vh, 620px);
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.hud-pal__search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-bottom: 1px solid var(--line-2); color: var(--muted); flex: none; }
.hud-pal__input { flex: 1; height: 100%; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 15px; }
.hud-pal__input::placeholder { color: var(--faint); }
.hud-pal__list { flex: 1; min-height: 0; padding: 6px; }
.hud-pal__ghead { padding: 10px 10px 4px; }
.hud-pal__opt {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
}
.hud-pal__opt[aria-selected='true'] { background: var(--bg-4); }
.hud-pal__opt.is-disabled { opacity: 0.55; }
.hud-pal__ico { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.hud-pal__ico svg { width: 16px; height: 16px; }
.hud-pal__ico.tone-red { color: var(--red); }
.hud-pal__ico.tone-amber { color: var(--amber-2); }
.hud-pal__ico.tone-muted { color: var(--muted); }
.hud-pal__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hud-pal__title { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-pal__title mark { background: transparent; color: var(--blue-2); font-weight: 600; }
.hud-pal__sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-pal__aside { flex: none; display: inline-flex; gap: 3px; }
.hud-pal__empty { padding: 34px 20px; }
.hud-pal__hint { padding: 10px 12px 6px; font-size: var(--fs-xs); color: var(--faint); }
.hud-pal__foot {
  display: flex; align-items: center; gap: 14px; flex: none;
  padding: 8px 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted);
}
.hud-pal__foot span { display: inline-flex; align-items: center; gap: 4px; }
.hud-pal__count { margin-left: auto; }

/* ─── Narrow screens ──────────────────────────────────────────────────────── */
@media (max-width: 1439px) {
  .hud-search { width: 36px; padding: 0; justify-content: center; }
  .hud-search__text, .hud-search__keys { display: none; }
  .hud-planner { max-width: 200px; }
}
@media (max-width: 1180px) {
  .hud-debrief__text { display: none; }
  .hud-scn { max-width: 230px; }
  .hud-field__label { display: none; }
  .hud-field { height: 32px; }
}
@media (max-width: 900px) {
  .hud-planner, .hud-cluster--mid .hud-jobs { display: none; }
  .hud-brand__word { display: none; }
}
@media (max-width: 600px) {
  .hud-cluster--right .hud-rule, .hud-ibtn[data-action='fullscreen'], .hud-ibtn[data-action='export'] { display: none; }
  .hud-scn { max-width: 150px; }
}
