/* The viewer: the top bar's six slots, the stage placeholder beneath them, and
   the panel a slot opens over it. */
.fo-viewer-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}
.fo-viewer-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.fo-viewer-main > .fo-stage {
  flex: 1;
  min-height: 0;
}
.fo-published-viewer {
  --mokly-accent: var(--mk-color-accent-solid);
  --mokly-accent-contrast: var(--mk-color-on-accent);
  --mokly-accent-soft: var(--mk-color-accent-soft);
  flex: 1;
  min-height: 0;
}
.fo-published-viewer > div {
  height: 100%;
}
.fo-package-slot {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--mk-space-2);
  height: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0 var(--mk-space-2);
  border-bottom: 1px solid var(--mk-color-border);
  background: var(--mk-color-surface);
}
.fo-package-slot:not(.fo-package-slot-compact) {
  max-width: calc(50vw - 4.5rem);
}
.fo-package-slot-start {
  padding-left: var(--mk-space-4);
}
.fo-package-slot-end {
  justify-content: flex-end;
  padding-right: var(--mk-space-4);
}
.fo-package-publication {
  display: flex;
  align-items: center;
  flex: 1 1 54%;
  flex-wrap: nowrap;
  gap: var(--mk-space-2);
  min-width: 0;
  overflow: hidden;
}
.fo-package-slot-compact {
  max-width: none;
  padding-inline: 0;
}
.fo-package-slot-compact .fo-top-state,
.fo-compact-publication .fo-top-state {
  display: none;
}
.fo-viewer-overlay {
  display: flex;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--mk-color-background) 92%, transparent);
}
.fo-top-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--mk-space-1) var(--mk-space-4);
  flex-shrink: 0;
  min-height: var(--mk-layout-topbar);
  padding: 0 var(--mk-space-4);
  border-bottom: 1px solid var(--mk-color-border);
}
.fo-top-slot {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--mk-space-1) var(--mk-space-2);
  min-width: 0;
}
.fo-top-leading,
.fo-top-trail {
  max-width: calc(50vw - 4.5rem);
  overflow: hidden;
}
.fo-top-leading {
  flex: 0 1 auto;
}
.fo-top-project {
  display: flex;
  flex: 1 1 46%;
  min-width: 0;
  overflow: hidden;
}
.fo-top-reference {
  display: flex;
  flex: 0 1 9rem;
  min-width: 0;
  overflow: hidden;
}
.fo-top-variable-control {
  display: flex;
  width: 100%;
  min-width: 0;
}
.fo-top-fixed {
  display: flex;
  flex: 0 0 auto;
}
.fo-top-account {
  flex: 1 1 12rem;
  min-width: 3rem;
  max-width: 20rem;
  overflow: hidden;
}
.fo-top-grow {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  overflow: hidden;
}
.fo-top-trail {
  flex: 0 1 auto;
  justify-content: flex-end;
}
.fo-top-state {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: var(--mk-space-1) var(--mk-space-2);
  min-width: 0;
  overflow: hidden;
  color: var(--mk-color-text-muted);
  font-size: var(--mk-type-ui-small-size);
  line-height: var(--mk-type-ui-small-line);
}
.fo-top-state-detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fo-top-state .mono-value {
  flex: 0 0 auto;
  overflow-wrap: normal;
  white-space: nowrap;
}
.fo-top-bar-stacked {
  display: block;
  padding: 0;
}
.fo-top-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mk-space-2);
  min-height: var(--mk-layout-topbar);
  padding: var(--mk-space-1) var(--mk-space-4);
}
.fo-top-row + .fo-top-row {
  border-top: 1px solid var(--mk-color-border);
  padding-bottom: var(--mk-space-2);
}
.fo-top-row-publication {
  align-items: flex-start;
  padding-top: var(--mk-space-1);
}
.fo-top-badge {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.fo-stage-card {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: var(--mk-space-10) var(--mk-layout-gutter-mobile);
}
.fo-stage-card > * {
  width: 100%;
  max-width: 420px;
}
.fo-stage-card > .fo-pending {
  max-width: 560px;
}
.fo-state-pair {
  justify-content: center;
}
.fo-viewer-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fo-viewer-backdrop > .fo-stage {
  flex: 1;
  min-height: 0;
}
.fo-viewer-surface {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--mk-space-8);
  background: color-mix(in srgb, var(--mk-color-text) 34%, transparent);
  backdrop-filter: blur(3px);
}
.fo-panel-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--mk-space-6);
}
.fo-panel-foot {
  display: flex;
  justify-content: flex-start;
}
.fo-ref-group {
  display: grid;
  gap: var(--mk-space-2);
  justify-items: start;
}
.fo-ref-group > * {
  width: 100%;
}
.fo-ref-group > .fo-panel-foot {
  margin-top: calc(-1 * var(--mk-space-1));
}
.fo-ref-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--mk-space-3);
}
.fo-ref-name {
  display: block;
  color: var(--mk-color-text-muted);
  font-size: var(--mk-type-ui-label-size);
  line-height: var(--mk-type-ui-label-line);
  font-weight: var(--mk-type-ui-label-weight);
  letter-spacing: 0.02em;
}
.fo-ref-detail {
  color: var(--mk-color-text-muted);
  font-size: var(--mk-type-ui-small-size);
  line-height: var(--mk-type-ui-small-line);
}
@media (max-width: 767px) {
  .fo-viewer-surface {
    align-items: flex-end;
    padding: 0;
  }
  .fo-stage-card {
    padding: var(--mk-space-8) var(--mk-layout-gutter-mobile);
  }
}
