/* The step's panel (src/ui/panels.js): header, sections, the run queue, the footer, references, versions. */
/* ---- the step's panel: header (what it is, where it stands, up/down), versions, sections, actions --------- */
.inspector {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--pane);
}
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px 16px;
}
.ph-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ph-op {
  display: grid;
  place-items: center;
  flex: none;
  margin-right: -2px;
  color: var(--label);
}
.ph-title {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-title);
  font-weight: var(--fw-title);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-sub {
  color: var(--label);
  font-size: var(--fs-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-back {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 10px 16px 0 12px;
  border: 0;
  background: none;
  color: var(--link);
  font-weight: var(--fw-button);
  cursor: pointer;
  text-align: left;
}
.ph-back span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-back:is(:hover, .is-hover) span {
  text-decoration: underline;
}
/* the tile's header: back where a step's icon is, a raised button (the way out of the tile) */
.btn.square.ph-backbtn {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: -2px 0 -2px -4px;
}
/* the panel's edge arrows (up and down the lineage): a quiet strip at the top and the bottom edge */
/* up / down the lineage: strips on the panel's top and bottom edges */
/* versions: ‹ 2 of 3 › */
.pager {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--label);
  font-size: var(--fs-text);
  font-weight: var(--fw-text);
  font-variant-numeric: tabular-nums;
}
.pager button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.pager button:is(:hover, .is-hover):not(:disabled) {
  background: var(--flat-hover);
}
.pager button:disabled {
  opacity: 0.3;
  cursor: default;
}
.panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.panel-body {
  gap: 22px;
  padding: 4px 18px 22px;
}
.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sec:empty {
  display: none;
}
/* header and note text are indented to the row text inside the groups (12 px + the border), so a column label
   ("price per run") sits right over its column */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--label);
  font-weight: var(--fw-title);
}
.sec-aside {
  color: var(--dim);
  font-weight: var(--fw-text);
}
.sec-aside.warn {
  color: var(--warn);
  font-weight: var(--fw-text);
}
/* the post steps: under a full-width dark line, as the footer is, with the footer's padding; a title (as every
   section's) over one group of rows */

.sec-aside.data {
  color: var(--text);
  font-size: var(--fs-text);
}
.sec-note {
  color: var(--dim);
  font-size: var(--fs-text);
  line-height: 1.45;
}
.panel-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px 16px;
  background: var(--pane);
  border-top: 1px solid var(--edge);
}
.panel-foot:empty {
  display: none;
}
.foot-out {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: var(--fs-text);
  white-space: nowrap;
  overflow: hidden;
}
.foot-out > .label:first-child {
  font-weight: var(--fw-text);
} /* Output / Result */
.foot-out > .label:first-child {
  flex: 1;
}
.foot-out .data {
  font-size: var(--fs-text);
}
.foot-out .foot-none {
  color: var(--dim);
  font-weight: var(--fw-text);
  -webkit-user-select: none;
  user-select: none;
} /* no output yet: a note, not data */
/* the input's file facts */
.facts {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.fact {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
}
.fact + .fact {
  border-top: 1px solid var(--group-line);
}
.fact dt {
  width: 92px;
  flex: none;
  color: var(--label);
}
.fact dd {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: var(--fw-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the run queue (queue.js): a full-width row per run over the panel's footer, like sections, apart by the edge line;
   a 2 px line at its bottom edge is its progress */
.queue {
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--pane);
}
.queue-item {
  display: grid;
  grid-template-rows: 1fr;
  animation: queue-in var(--t-fade) var(--ease);
  transition:
    grid-template-rows var(--t-fade) var(--ease),
    opacity var(--t-fade),
    transform var(--t-fade) var(--ease);
}
.queue-item > div {
  min-height: 0;
  overflow: hidden;
}
.queue-item.leaving {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(8px);
} /* the way it came in, backwards */
@keyframes queue-in {
  from {
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(8px);
  }
}
.queue-bar {
  position: relative;
  padding: 0 12px 0 18px;
  border-top: 1px solid var(--edge);
  background: var(--pane);
  overflow: hidden;
  cursor: pointer;
}
.queue-bar:is(:hover, .is-hover) {
  background-image: linear-gradient(var(--row-hover), var(--row-hover)); /* over its own color (a failed bar is red) */
}
.queue-bar.failed {
  background-color: var(--error-bg); /* (the color only: the hover tint is a background image over it) */
}
.queue-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
}
.queue-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: var(--fs-text);
  font-weight: var(--fw-text);
}
.queue-facts {
  flex: none;
  color: var(--label);
  font-size: var(--fs-text);
  font-weight: var(--fw-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.queue-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--label);
  cursor: pointer;
}
.queue-x:is(:hover, .is-hover) {
  background: var(--flat-hover);
  color: var(--text);
}
.queue-error {
  margin: -4px 0 0;
  padding: 0 6px 10px 0;
  color: var(--error);
  font-size: var(--fs-text);
  font-weight: var(--fw-text);
  line-height: 1.45;
}
.queue-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s linear;
}
.queue-progress.indeterminate {
  width: 35%;
  animation: sweep 1.4s ease-in-out infinite;
}
.queue-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--ok);
}
.queue-more {
  display: block;
  width: 100%;
  padding: 8px 18px;
  border-top: 1px solid var(--edge);
  text-align: left;
  font-size: var(--fs-text);
}
.foot-row {
  display: flex;
  gap: 8px;
}
.foot-row > .btn.wide {
  flex: 1;
  width: auto;
  min-width: 0;
}
.panel-foot .btn {
  height: 34px;
  font-size: var(--fs-text);
}
.error-box {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--error-bg);
  color: var(--error);
  line-height: 1.45;
}

/* disclosure */
.disc-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* everything after the title, together at the right (not spread across the row) */
.disc-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.disc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--label);
  font-weight: var(--fw-title);
  cursor: pointer;
  user-select: none;
}
.disc-toggle:is(:hover, .is-hover) {
  color: var(--text);
}
.disc-toggle .i {
  transition: transform var(--t-state) var(--ease);
}
.disc.open .disc-toggle .i {
  transform: rotate(90deg);
}
.disc-body {
  margin-top: 10px;
}
.disc-gap {
  height: 14px;
}

/* prompt, references, versions */
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.placeholder {
  color: var(--dim);
}
/* the edit's images: one recessed area that takes drops and (focused) pastes; each image removable, draggable */
.refs {
  display: grid;
  grid-template-columns: repeat(4, var(--thumb));
  justify-content: space-between;
  gap: 12px 10px;
  padding: 10px;
  outline: none;
  transition:
    border-color var(--t-state),
    background-color var(--t-state);
}
.refs:focus-within {
  border-color: var(--draft-line);
}
.refs:focus {
  border-color: var(--accent);
}
.refs.drop {
  border: 1px dashed var(--accent);
  background: var(--drop-bg);
}
.ref {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: none;
}
.ref[draggable="true"] {
  cursor: grab;
}
.ref-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
}
.ref-frame > .ref-img {
  position: absolute;
  inset: 0;
} /* always the square: the image fills it (cover), whatever its shape */
.ref-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: var(--black);
  box-shadow: 0 0 0 1px var(--white-16);
}
.ref:is(:focus-visible, .is-focus) .ref-img,
.ref:focus .ref-img {
  box-shadow: 0 0 0 2px var(--accent);
}
.ref-n {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--black-78);
  font-size: var(--fs-tiny);
  font-weight: var(--fw-text);
  line-height: 20px;
  text-align: center;
}
.ref-cap {
  color: var(--label);
  font-size: var(--fs-tiny);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref.fixed .ref-cap {
  color: var(--text);
}
button.ref-corner {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--white);
  cursor: pointer;
  transition: background-color var(--t-state);
}
.ref-corner .rc-del {
  display: none;
}
.ref:is(:hover, .is-hover) .ref-corner:not(:disabled),
.ref:focus .ref-corner:not(:disabled) {
  background: var(--corner);
}
.ref:is(:hover, .is-hover) .ref-corner:not(:disabled) .rc-n,
.ref:focus .ref-corner:not(:disabled) .rc-n {
  display: none;
}
.ref:is(:hover, .is-hover) .ref-corner:not(:disabled) .rc-del,
.ref:focus .ref-corner:not(:disabled) .rc-del {
  display: block;
}
.ref .ref-corner:is(:is(:hover, .is-hover), .asking):not(:disabled) {
  background: var(--danger);
}
.ref:has(.ref-corner:is(:is(:hover, .is-hover), .asking):not(:disabled)) .ref-img {
  box-shadow: 0 0 0 2px var(--danger);
}
/* an image on its way in: its place at once, the picture when it is stored */
.ref-img.ref-wait {
  display: grid;
  place-items: center;
  background: var(--group);
  box-shadow: 0 0 0 1px var(--white-14);
}
.ref-box {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--field-hover);
  color: var(--label);
  transition:
    border-color var(--t-state),
    color var(--t-state);
}
.ref-add {
  cursor: pointer;
}
.ref-add:is(:hover, .is-hover):not(:disabled):not(.off) .ref-box {
  border-color: var(--text);
  color: var(--text);
}
.ref-add:is(:hover, .is-hover):not(:disabled):not(.off) .ref-cap {
  color: var(--text);
}
.ref-add:disabled,
.ref-add.off {
  opacity: 0.45;
  cursor: default;
}
.versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.version {
  position: relative;
}
.version-pick {
  display: block;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: none;
  cursor: pointer;
}
.version-img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--black);
}
.tile-version.on .version-pick {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.tile-version.drift .version-pick {
  border-color: var(--warn);
}
.tile-meter {
  height: 4px;
  border-radius: 2px;
  background: var(--group);
  overflow: hidden;
}
.tile-meter span {
  display: block;
  height: 100%;
  background: var(--ok);
  transition: width var(--t-move) var(--ease);
}
.tile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 8px 0 12px;
}
.btn.small {
  height: 26px;
  padding: 0 10px;
  font-size: var(--fs-text);
}
.preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--black);
  box-shadow: 0 0 0 1px var(--white-12);
}
.zoomable {
  cursor: zoom-in;
}
