/* mgf-fed-web — app-domain compositions only.
 *
 * The console CHROME (dark top-bar + rail + printable readout) is the KIT's
 * `.mgf-console` shell since mgf-brand-web 0.4.0 (console.css + the
 * mgf/console.html template — M1 P4.2 lifted it from here); the state chips /
 * workflow chips / origin badges / derived tag / honest absence live in the
 * kit's instruments.css. This file keeps only what is genuinely fed-web's:
 * the sync matrix's commit cell, the roadmap chain, the architecture node
 * list, panels/headers, and the sync-action affordances. EVERY colour is a
 * mgf-brand-web token so it reads identical to the kit and flips in dark
 * mode. Additive: no kit class is touched.
 */

/* Generic flex spacer (panel heads, header strips). */
.fw-spacer {
  flex: 1;
}

/* The top-bar "last checked" line (renders on the dark kit chrome). */
.fw-lastcheck {
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--mgf-mist) 58%, transparent);
}

/* ----------------------------------------------------------- view header -- */
.fw-view-h {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.fw-view-h__t {
  font-size: 1.4rem;
  margin: 0;
}
.fw-view-h__s {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.fw-lede {
  max-width: 80ch;
  margin-top: var(--space-2);
}
.fw-lensbar {
  margin: var(--space-3) 0 var(--space-6);
}

/* Panels reuse .card; give the head a quiet divider and a note slot. */
.fw-panel {
  padding: 0;
  margin-bottom: var(--space-6);
  overflow: hidden;
}
.fw-panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.fw-panel__title {
  margin: 0;
  font-size: 1rem;
}
.fw-panel__note {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.fw-panel .table-wrap {
  border: 0;
  border-radius: 0;
}
.fw-panel > .lead,
.fw-panel > .fw-arch-layer,
.fw-panel > .detail-block {
  margin: var(--space-4);
}

/* --------------------------------------------------------- sync matrix --- */
.fw-matrix__name {
  text-decoration: none;
  color: var(--color-text);
}
.fw-matrix__name b {
  font-weight: 600;
}
.fw-matrix__name span {
  display: block;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.fw-commits {
  font-size: 0.75rem;
}
.fw-arrow {
  color: var(--color-text-muted);
  margin: 0 0.35rem;
}
.fw-behind {
  color: var(--color-warning-text);
}
.fw-resultline {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* --------------------------------------------------- project header strip - */
.fw-phead {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-2);
}
.fw-phead__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.fw-phead__kind {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.fw-phead__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.fw-phead__sp {
  flex: 1;
}
.fw-phead-gap {
  margin-top: var(--space-6);
}
.fw-ribbon {
  margin: var(--space-4) 0 var(--space-2);
}
.fw-tabs {
  margin: var(--space-4) 0 var(--space-6);
}

/* ---------------------------------------------------------- roadmap chain - */
.fw-chain {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  padding: var(--space-4);
  overflow-x: auto;
}
.fw-chain__node {
  flex: 1 1 9rem;
  min-width: 9rem;
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-bg);
}
.fw-chain__node--here {
  border-color: color-mix(in srgb, var(--state-busy) 55%, var(--color-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-busy) 40%, transparent);
}
.fw-chain__here {
  position: absolute;
  top: -0.7rem;
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--state-busy);
  border-radius: var(--radius-pill);
  padding: 0.1rem var(--space-2);
}
.fw-chain__label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}
.fw-chain__bar {
  margin: var(--space-2) 0 0.35rem;
}
.fw-chain__pct {
  font-size: 0.66rem;
  color: var(--color-text-muted);
}
.fw-chain__link {
  display: flex;
  align-items: center;
  padding: 0 0.35rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.fw-cell-title {
  font-weight: 540;
}

/* --------------------------------------------------- architecture graph -- */
.fw-arch-layer {
  margin-bottom: var(--space-4);
}
.fw-arch-layer__h {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
}
.fw-arch-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-2);
}
.fw-node {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
}
.fw-node__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
}
.fw-node__deps {
  font-size: 0.66rem;
  color: var(--color-text-muted);
}

/* ----------------------------------------------------------- work cards -- */
.fw-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.fw-task {
  padding: var(--space-4);
}
.fw-task__h {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.fw-task__t {
  flex: 1;
  min-width: 12rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.fw-task__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.fw-task .detail-block,
.fw-task .evidence {
  margin-top: var(--space-3);
}

/* The workflow chip (.tstate), derived tag (.derived-tag) and honest-absence
 * composition (.absence) moved INTO the kit (instruments.css, 0.4.0) — the
 * macros in macros.html now wrap the kit pack's. */

/* ------------------------------------------------- M3 · sync actions ----- */
/* Action forms collapse to inline so the buttons sit in a row (topbar, header,
 * matrix cell) instead of stacking as block-level <form>s. */
.fw-actform,
.fw-phead__act form,
.fw-matrix__act form {
  display: inline-flex;
  margin: 0;
}
.mgf-console__topbar > .fw-actform,
.mgf-console__topbar > .fw-confirm {
  flex: 0 0 auto;
}

/* The affirmative-action accent (Force-sync): a gold OUTLINE so the single gold
 * FILL CTA budget (brand book Part VIII) is spent only on the confirmed action
 * revealed inside the disclosure pop. Reads gold on the dark chrome and on the
 * light readout (accent-strong flips with the theme). */
.fw-act--gold {
  background: transparent;
  color: var(--color-accent-strong);
  border-color: color-mix(in srgb, var(--mgf-gold) 55%, transparent);
}
.fw-act--gold:hover {
  background: color-mix(in srgb, var(--mgf-gold) 16%, transparent);
  color: var(--color-accent-strong);
  border-color: var(--mgf-gold);
}

/* Confirm disclosure — a brief, no-JS affordance before a force-sync mutation: the
 * <summary> is the trigger; opening it reveals the warning + the real submit. */
.fw-confirm {
  position: relative;
  display: inline-flex;
}
.fw-confirm > summary {
  list-style: none;
  cursor: pointer;
}
.fw-confirm > summary::-webkit-details-marker {
  display: none;
}
.fw-confirm__pop {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  width: 19rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-surface-raised);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.fw-confirm__warn {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* In-flight button — CHECKING/SYNCING: keep the (renamed) label, add a spinner.
 * Reduced-motion freezes the ring (the disabled state still reads). */
.button.is-busy {
  opacity: 0.9;
  cursor: progress;
}
.button.is-busy::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: fw-spin 0.7s linear infinite;
}
@keyframes fw-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before {
    animation: none;
  }
}

/* Per-project header actions + the honest "can't check" for unwired/unreadable. */
.fw-phead__act {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.fw-phead__noact {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* The action result line (under the header) — a quiet readout that prints. */
.fw-resultbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  font-size: 0.76rem;
}
.fw-resultbar__icon {
  font-weight: 700;
}
.fw-resultbar--ok {
  color: var(--color-success-text);
  background: var(--color-success-tint);
  border-color: color-mix(in srgb, var(--mgf-teal) 35%, transparent);
}
.fw-resultbar--warn {
  color: var(--color-warning-text);
  background: var(--color-warning-tint);
  border-color: color-mix(in srgb, var(--mgf-warning) 35%, transparent);
}

/* Matrix per-row actions + the in-sync result-line tint. */
.fw-matrix__acth,
.fw-matrix__act {
  text-align: right;
  white-space: nowrap;
}
.fw-matrix__act form + form {
  margin-left: var(--space-2);
}
.fw-resultline--ok {
  color: var(--color-success-text);
}

/* ------------------------------------------------------------ print ------- */
/* The kit's console.css strips the shell chrome (topbar/rail/buttons) and
 * flattens the readout; this adds only the fed-web-specific hides + keeps the
 * app's own panels unbroken across pages (spec §5.8 — every view prints). */
@media print {
  .fw-tabs,
  .fw-lensbar,
  .fw-phead__act,
  .fw-confirm,
  .fw-matrix__acth,
  .fw-matrix__act {
    display: none !important;
  }
  .fw-panel,
  .fw-phead,
  .fw-task {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* --- M6 Follow-live: shell glue only (the brand kit owns .live-pane / .progress) --- */
.fw-livemark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 0.78rem;
}
.fw-livemark__link {
  font-family: var(--font-mono);
  font-weight: 600;
  text-decoration: none;
}
.fw-livemark__link:hover {
  text-decoration: underline;
}
.fw-live__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.fw-live__hint,
.fw-live__telemetry {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.fw-live__telemetry {
  margin-top: var(--space-3);
}
