/* ==========================================================================
   status.css — adaptive orchestration status
   --------------------------------------------------------------------------
   Figma authority: node 723:2945.

   Measured from the design, not approximated:
     type      Geist 400 / 11.793px / 1.25 / letter-spacing 0.1179px / #9f9792
     glyph     15 x 15px, 4px gap to the label
     group     7px between the header and its disclosure body
     nest      8px left inset, 2px block padding, 12px guide→rows gap
     nest rows 8px between capability rows
     summary   11.79px on a 20.286px line

   One type size, one ink, no cards, no gradients, no progress bars. Motion is a
   3px rise and an opacity fade; disclosure animates grid-template-rows so the
   panel has no measured height to maintain.
   ========================================================================== */

:root {
  --ostat-ink:      #9f9792;
  --ostat-guide:    rgba(159, 151, 146, 0.45);
  --ostat-hover:    rgba(50, 47, 47, 0.035);
  --ostat-focus:    rgba(234, 67, 53, 0.6);
  --ostat-font:     11.793px;
  --ostat-track:    0.1179px;
  --ostat-glyph:    15px;
  --ostat-gap:      4px;
  --ostat-row-gap:  15px;
  --ostat-ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ostat-appear:   360ms;
  --ostat-expand:   300ms;
}

/* =============================== the list ================================ */

.ostat {
  display: flex;
  flex-direction: column;
  gap: var(--ostat-row-gap);
  width: 100%;
  min-width: 0;
}
.ostat:empty { display: none; }

/* ================================ one row ================================ */

.ostat-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.ostat-row__head {
  display: flex;
  align-items: center;
  gap: var(--ostat-gap);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 8px;
  cursor: default;
  animation: ostat-row-in var(--ostat-appear) var(--ostat-ease) both;
}
.ostat-row.is-expandable .ostat-row__head { cursor: pointer; }
.ostat-row.is-expandable .ostat-row__head:hover { background: var(--ostat-hover); }
.ostat-row__head:focus-visible {
  outline: 2px solid var(--ostat-focus);
  outline-offset: 1px;
}

/* Collapsed chevron points right; expanded points down (Figma 720:2897 / 663:6713). */
.ostat-row__chevron {
  width: var(--ostat-glyph);
  height: var(--ostat-glyph);
  flex: 0 0 auto;
  display: block;
  opacity: 0.55;
  transform: rotate(-90deg);
  transition: transform 240ms var(--ostat-ease), opacity 240ms var(--ostat-ease);
}
.ostat-row:not(.is-expandable) .ostat-row__chevron { visibility: hidden; }
.ostat-row.is-expanded .ostat-row__chevron { transform: rotate(0deg); }

.ostat-row__icon {
  width: var(--ostat-glyph);
  height: var(--ostat-glyph);
  flex: 0 0 auto;
  display: block;
}
.ostat-row__icon[hidden] { display: none; }

.ostat-row__label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--ostat-font);
  line-height: 1.25;
  letter-spacing: var(--ostat-track);
  color: var(--ostat-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Hierarchy: the row Argus is working on now holds the ink; rows that have
   settled recede into history without disappearing. One step of opacity, no
   second colour, no weight change. */
.ostat-row[data-lifecycle="running"] .ostat-row__label {
  animation: ostat-breathe 2.8s var(--ostat-ease) infinite;
}
.ostat-row[data-lifecycle="completed"] .ostat-row__label {
  opacity: 0.72;
  transition: opacity var(--ostat-appear) var(--ostat-ease);
}
.ostat-row[data-lifecycle="failed"] .ostat-row__label { opacity: 0.75; }
.ostat-row[data-lifecycle="skipped"] .ostat-row__label { opacity: 0.6; }

/* Once the whole block is history, nothing inside it is "current" any more. */
.ostat[data-status="done"] .ostat-row__label,
.ostat[data-status="failed"] .ostat-row__label { opacity: 0.72; }

/* Supporting metadata: same type, quieter, separated by a middot. */
.ostat-row__detail {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--ostat-font);
  line-height: 1.25;
  letter-spacing: var(--ostat-track);
  color: var(--ostat-ink);
  opacity: 0.55;
  white-space: nowrap;
  flex: 0 0 auto;
}
.ostat-row__detail[hidden] { display: none; }
.ostat-row__detail::before { content: '·'; margin: 0 4px 0 0; }

/* ============================== disclosure =============================== */

.ostat-row__panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--ostat-expand) var(--ostat-ease),
              opacity var(--ostat-expand) var(--ostat-ease);
}
.ostat-row.is-expanded .ostat-row__panel { grid-template-rows: 1fr; opacity: 1; }
.ostat-row__clip { overflow: hidden; min-height: 0; }

/* Figma 663:6716 — 8px inset, 2px block padding, 12px between guide and rows. */
.ostat-nest {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 2px 0 2px 8px;
  min-width: 0;
}
.ostat-nest__guide {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  background: var(--ostat-guide);
}
.ostat-nest__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

/* ======================= nested capability rows ========================== */

.ostat-caps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ostat-cap {
  display: flex;
  align-items: center;
  gap: var(--ostat-gap);
  min-width: 0;
}
.ostat-cap__label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--ostat-font);
  line-height: 1.25;
  letter-spacing: var(--ostat-track);
  color: var(--ostat-ink);
  overflow-wrap: anywhere;
}
.ostat-cap[data-lifecycle="running"] .ostat-cap__label {
  animation: ostat-breathe 2.8s var(--ostat-ease) infinite;
}
.ostat-cap[data-lifecycle="failed"] .ostat-cap__label { opacity: 0.7; }
.ostat-cap[data-lifecycle="skipped"] .ostat-cap__label { opacity: 0.55; }

/* The model mark: quiet provenance, never a headline (Figma 663:6721). */
.ostat-cap__mark {
  width: var(--ostat-glyph);
  height: var(--ostat-glyph);
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}

/* ========================== verification detail ========================== */

.ostat-checks {
  margin: 0;
  padding-left: 14px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ostat-checks__item {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--ostat-font);
  line-height: 1.45;
  letter-spacing: var(--ostat-track);
  color: var(--ostat-ink);
  overflow-wrap: anywhere;
}
.ostat-checks__item[data-passed="false"] { opacity: 0.8; }

.ostat-contrib { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ====================== compact final attribution ======================== */

.ostat-summary {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--ostat-font);
  line-height: 20.286px;
  letter-spacing: var(--ostat-track);
  color: var(--ostat-ink);
  overflow-wrap: anywhere;
  animation: ostat-row-in var(--ostat-appear) var(--ostat-ease) both;
}

/* ================================ motion ================================= */

@keyframes ostat-row-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ostat-breathe {
  0%, 100% { opacity: 0.78; }
  50%      { opacity: 1; }
}

@media (max-width: 560px) {
  :root { --ostat-row-gap: 13px; }
  .ostat-nest { gap: 10px; }
  /* The label is the message; the count is an aid. Narrow viewports keep the
     message whole rather than squeezing both onto one line. */
  .ostat-row__detail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ostat-row__head,
  .ostat-summary {
    animation-duration: 1ms !important;
    transform: none !important;
  }
  .ostat-row[data-lifecycle="running"] .ostat-row__label,
  .ostat-cap[data-lifecycle="running"] .ostat-cap__label { animation: none; }
  .ostat-row[data-lifecycle="completed"] .ostat-row__label { transition: none; }
  .ostat-row__chevron { transition: none; }
  .ostat-row__panel { transition: opacity 1ms; }
}
