

.fx-view-tabs {
  margin-bottom: var(--ds-space-5);
}
.fx-card h3 { font-weight: var(--ds-weight-semibold); }
.fx-note {
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  color: var(--muted);
  margin-top: 20px;
}
.fx-source {
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  color: #e8c779;
  margin-top: 12px;
}
#factory-live .fx-text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 16px;
  min-height: 36px;
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  color: #8e96ef;
}
#factory-live .fx-text-link:hover { text-decoration: underline; }
.fx-text-link .fx-icon {
  width: 16px;
  height: 16px;
}

.fx-panel .ds-panel__tile.fx-green-icon {
  color: #70c99c;
}
.fx-panel-chevron {
  flex: none;
  width: var(--ds-icon-xs);
  height: var(--ds-icon-xs);
  color: var(--ds-text-faint);
}
.fx-panel-more {
  margin-top: var(--ds-space-3);
}
.fx-panel-note {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  font-size: var(--ds-size-13);
  line-height: var(--ds-leading-body);
  color: var(--ds-text-faint);
}
.fx-panel-note:empty {
  display: none;
}
.fx-event {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ds-border);
}
.fx-event .fx-icon {
  margin-top: 4px;
  color: var(--muted);
}
.fx-event > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.fx-event h3 {
  font-size: var(--ds-size-16);
  line-height: var(--ds-leading-body);
  margin-bottom: 4px;
}
.fx-event p, .fx-event time {
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  color: var(--muted);
}
.fx-event time {
  margin-left: auto;
  white-space: nowrap;
}
.fx-event a {
  color: #a0a7ff !important;
  margin-right: 8px;
}
.fx-system {
  margin-top: 24px;
  border: 1px solid #30343a;
  border-radius: 12px;
  background: #191b1e;
}
.fx-system summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.fx-system summary::-webkit-details-marker { display: none; }
.fx-system summary > span:nth-child(2) { flex: 1; }
.fx-system strong {
  display: block;
  font-size: var(--ds-size-16);
  font-weight: var(--ds-weight-medium);
  color: var(--text);
}
.fx-system small {
  display: block;
  font-size: var(--ds-size-14);
  margin-top: 4px;
}
.fx-system > div {
  padding: 16px 20px;
  border-top: 1px solid var(--ds-border);
  color: var(--muted);
  font-size: var(--ds-size-14);
}
.fx-system a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a0a7ff !important;
  margin-top: 12px;
}
.fx-empty {
  padding: 40px 16px;
  text-align: center;
  margin: auto;
  max-width: 65ch;
}
.fx-empty h3 {
  font-size: var(--ds-size-16);
  line-height: var(--ds-leading-body);
  font-weight: var(--ds-weight-medium);
  margin-bottom: 8px;
}
.fx-empty p {
  color: var(--muted);
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  text-wrap: pretty;
}
.fx-spend .fx-empty {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fx-runs .fx-empty { min-height: 270px; }

.fx-recap > .fx-card-heading {
  flex-wrap: wrap;
  margin: 0;
}
.fx-recap-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.fx-recap-title > small {
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
  font-weight: var(--ds-weight-regular);
  color: var(--ds-text-muted);
}
#fx-menu { display: none; }
body:has(.view[data-view="factory"].on) .runas {
  min-height: 38px;
  font-family: var(--ds-font); font-variant-numeric: var(--ds-numeric);
  font-size: var(--ds-size-14);
  letter-spacing: .025em;
}
@container (max-width:620px) {
  .fx-ticket {
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content) auto;   
  column-gap: var(--ds-space-3);
  row-gap: 4px;
}
  .fx-ticket-copy { display: contents; }   
  .fx-ticket-title {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: start;
}
  .fx-ticket-meta {
  grid-column: 1 / -1;
  grid-row: 3;
}
  .fx-ticket-state {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}
  .fx-cost {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  text-align: left;
}
  .fx-chevron {
  grid-column: 3;
  grid-row: 1 / 3;
}
  
  .fx-matrix {
  width: calc(3 * var(--fx-matrix-tile) + 2 * var(--fx-matrix-gap));
  overflow: hidden;
}
}
@media (min-width:1600px) {
  .fx-wrap { padding: 32px; }
  .fx-layout { grid-template-columns: minmax(0, 1fr) 400px; }
  .fx-card:not(.fx-tickets) { padding: 24px; }
}

@container fx-page (max-width: 983px) {
  .fx-layout { grid-template-columns: minmax(0, 1fr); }
  .fx-work { display: contents; }
  .fx-side { order: 1; }
  .fx-delivery { order: 2; }
  
  .fx-insights {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@container fx-page (min-width: 760px) and (max-width: 983px) {
  .fx-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-spend { grid-row: span 2; }
}
@media (max-width:800px) {
  .fx-wrap { padding-inline: 20px; }
  
  .fx-summary { grid-template-columns: minmax(0, 1fr); }
  .fx-summary > .fx-kpi + .fx-kpi { box-shadow: inset 0 1px 0 var(--ds-border); }
  .fx-insights { grid-template-columns: minmax(0, 1fr); }
  .fx-spend { grid-row: auto; }
}
@media (max-width:560px) {
  .fx-wrap { padding: 22px 16px; }
  .fx-heading {
  flex-wrap: wrap;
  gap: 8px;
}
  .fx-heading h2 {
  font-size: var(--ds-size-24);
  line-height: var(--ds-leading-title);
  letter-spacing: var(--ds-tracking-tight);
}
  .fx-heading p {
  font-size: var(--ds-size-14);
  line-height: var(--ds-leading-body);
}
  .fx-overview-actions { justify-content: flex-start; }
  .fx-kpi-chart { width: 128px; }
  #fx-health-detail {
  left: 0;
  right: auto;
}
  .fx-layout {
  gap: 20px;
  margin: 20px 0;
}
  
  .fx-card, .fx-tickets, #factory-live .fx-kpi { --fx-card-pad: var(--ds-space-4); padding: var(--fx-card-pad); }
  .fx-tickets h2, .fx-delivery h2 { gap: 8px; }
  .fx-tickets .fx-card-heading { gap: 12px; }
  .fx-search {
  width: 182px;
  padding: 8px;
}
  #factory-live #fx-search {
  font-size: var(--ds-size-16);
  line-height: var(--ds-leading-body);
}
  .fx-search kbd { display: none; }
  .fx-ticket { padding: var(--ds-space-4) var(--fx-card-pad); }
  .fx-group-head { gap: 6px; }
  .fx-group-head h3 { gap: 6px; }
  #factory-live .fx-fold { margin-right: 0; }
  .fx-group-actions { gap: 8px; }
  .fx-event { flex-wrap: wrap; }
  .fx-event > div { flex: 1; }
  .fx-event time {
  margin-left: 34px;
  width: 100%;
}
}
