/* The build pages (/build, /build/j, /build/p) and the share page (/b). Uses the tokens from alma.css. */

.st [hidden] {
  display: none !important;
}

.st {
  /* What sits above the preview on a wide screen: the site's bar, this page's padding and the build's own bar. */
  --st-above: 10.75rem;
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem 1.25rem 2rem;
  align-items: start;
}

.st-rail {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.st-new {
  display: block;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-dark);
  background: var(--ember-hot);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
}

.st-new.is-current {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.st-rail-head {
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 0.4rem;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.st-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.st-list a {
  display: grid;
  gap: 0.1rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}

.st-list a:hover,
.st-list a:focus-visible {
  background: var(--surface-2);
}

.st-list a.is-current {
  border-color: var(--ember);
  background: var(--surface-2);
}

.st-list strong {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-list span,
.st-empty,
.st-note {
  font-size: var(--step--1);
  color: var(--muted);
}

.st-main {
  min-width: 0;
}

.st-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.st-card--form,
.st-card--job {
  max-width: 46rem;
  padding: 1.6rem 1.7rem;
}

.st-card h1,
.st-bar h1 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.st-card h2 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  margin: 0 0 0.6rem;
}

.st-lead {
  color: var(--muted);
  margin: 0 0 1.2rem;
  max-width: 60ch;
}

.st-form {
  display: grid;
  gap: 0.8rem;
}

.st-form label,
.st-budgets legend {
  font-weight: 700;
  font-size: var(--step--1);
}

.st-form textarea,
.st-form select,
.st-form input[type="number"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}

.st-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.st-form textarea:focus-visible,
.st-form select:focus-visible,
.st-retry-pick select:focus-visible,
.st-form input:focus-visible,
.st-button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.st-budgets {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.5rem;
}

.st-budgets legend {
  padding: 0 0 0.4rem;
}

.st-budget {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font-weight: 400;
}

.st-budget:has(input:checked) {
  border-color: var(--ember);
  background: var(--surface-2);
}

.st-budget input {
  margin-top: 0.25rem;
  accent-color: var(--ember-hot);
}

.st-budget em {
  display: block;
  font-style: normal;
  color: var(--muted);
}

.st-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 0.8rem;
}

.st-row > div {
  display: grid;
  gap: 0.3rem;
}

.st-pics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.st-pics-list li {
  position: relative;
  width: 5.5rem;
  height: 4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
}

.st-pics-list img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.st-pics-remove {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 9, 8, 0.82);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.st-pics-remove:hover,
.st-pics-remove:focus-visible { background: var(--bad); color: var(--ink-dark); }

.st-pics-warn { color: var(--yellow); }

.st-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* After a build ends without a result: the model for the next try. */
.st-retry-pick {
  display: grid;
  gap: 0.3rem;
  max-width: 28rem;
}

.st-retry-pick[hidden] { display: none; }

.st-retry-pick label {
  font-weight: 700;
  font-size: var(--step--1);
}

.st-retry-pick select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}

.st-button {
  font: inherit;
  font-weight: 700;
  color: var(--ink-dark);
  background: var(--ember-hot);
  border: 1px solid var(--ember-hot);
  border-radius: var(--radius);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.st-button:hover {
  filter: brightness(1.08);
}

.st-button[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.st-button--quiet {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
  font-weight: 500;
}

.st-button--quiet[aria-pressed="true"] {
  border-color: var(--ember);
  background: var(--surface-2);
}

.st-button--danger {
  color: var(--bad);
  background: transparent;
  border-color: var(--bad);
}

.st-error {
  color: var(--bad);
  margin: 0;
}

/* Something is running: a pulsing dot wherever it is mentioned. */
.st-live {
  display: inline-block;
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 0 0 rgba(255, 122, 47, 0.7);
  animation: st-pulse 1.6s ease-out infinite;
  vertical-align: middle;
}

@keyframes st-pulse {
  70% {
    box-shadow: 0 0 0 0.5rem rgba(255, 122, 47, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 122, 47, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-live {
    animation: none;
  }
}

.st-list--running a {
  border-color: rgba(255, 122, 47, 0.45);
  background: rgba(232, 89, 12, 0.08);
}

.st-tag {
  display: inline-flex;
  align-items: center;
  font-style: normal;
  font-size: var(--step--1);
  color: var(--ember-hot);
}

.st-running {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 122, 47, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(232, 89, 12, 0.14), rgba(232, 89, 12, 0.04));
}

.st-running p {
  margin: 0;
}

.st-running-head {
  font-weight: 700;
}

.st-running-step {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--yellow);
  overflow-wrap: anywhere;
}

/* A form that cannot be used yet. */
.st-form.is-locked {
  opacity: 0.45;
}

/* The progress page. A change shows the build as it is now beside the progress. */
.st-job {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.st-job--edit {
  grid-template-columns: minmax(22rem, 30rem) minmax(0, 1fr);
}

.st-job--edit .st-card--job {
  max-width: none;
}

.st-eyebrow {
  margin: 0 0 0.35rem;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-eyebrow a {
  color: var(--ember-hot);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  font-size: var(--step-0);
}

.st-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-now-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

@media (max-width: 1000px) {
  .st-job--edit {
    grid-template-columns: 1fr;
  }

  .st-preview--now {
    height: 60vh;
  }
}

.st-card--job blockquote {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--ember);
  background: var(--bg-2);
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.st-model {
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.st-meter {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--yellow);
  margin: 0 0 0.6rem;
}

.st-steps {
  margin: 0 0 1.1rem;
  /* Room for three-digit step numbers: the list scrolls, and a scrolling box clips markers that hang outside it. */
  padding: 0 0 0 3rem;
  max-height: 22rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  display: grid;
  gap: 0.2rem;
}

.st-steps li:last-child {
  color: var(--text);
}

.st-step-at {
  margin-right: 0.35rem;
  color: var(--muted);
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

.st-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.st-bar h1 {
  margin: 0;
}

.st-bar-title,
.st-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.st-pill {
  font-size: var(--step--1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  color: var(--muted);
}

.st-pill--public {
  color: var(--good);
  border-color: var(--good);
}

.st-pill--warn {
  color: var(--yellow);
  border-color: var(--yellow);
}

.st-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem);
  gap: 1rem;
  align-items: start;
}

/* On a wide screen the preview fills the window's height, and the options beside it scroll on their own. */
@media (min-width: 1001px) {
  .st-split .st-preview,
  .st-preview--now {
    height: calc(100vh - var(--st-above));
    height: calc(100dvh - var(--st-above));
    min-height: 26rem;
  }

  .st-split .st-side {
    max-height: calc(100vh - var(--st-above));
    max-height: calc(100dvh - var(--st-above));
    min-height: 26rem;
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

.st-preview {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: min(78vh, 60rem);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.st-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.st-preview.is-phone iframe {
  width: 390px;
  max-width: 100%;
  border-inline: 1px solid var(--border);
}

.st-side {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

/* What an admin has put in force on a build, told to whoever has it open. */
.st-held {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  background: rgba(255, 107, 107, 0.08);
  font-size: var(--step--1);
}

.st-needs {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  background: rgba(255, 209, 102, 0.08);
  font-size: var(--step--1);
}

.st-needs p,
.st-needs ul { margin: 0; }
.st-needs ul { padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.st-own input { flex: 1; min-width: 12rem; }

.st-held p {
  margin: 0;
}

.st-pill--held {
  color: var(--bad);
  border-color: var(--bad);
}

.ab-hold {
  display: grid;
  gap: 0.5rem;
  max-width: 46rem;
  margin: 1rem 0;
}

.ab-hold p,
.ab-hold ul {
  margin: 0;
}

/* An admin looking at someone else's build. */
.st-foreign {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  background: rgba(255, 225, 74, 0.08);
  font-size: var(--step--1);
}

.st-foreign p {
  margin: 0;
}

.st-rail-more {
  margin: 0.5rem 0 0;
  font-size: var(--step--1);
}

/* The menu that picks which section of the side column shows. It stays in view while the section scrolls. */
.st-pick {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.st-pick label {
  flex: none;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-pick select {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.st-panel {
  display: grid;
  gap: 0.8rem;
}

.st-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0;
}

.st-facts dt {
  font-size: var(--step--1);
  color: var(--muted);
}

.st-facts dd {
  margin: 0;
  font-weight: 700;
}

/* Admin: cards side by side, the search above the list, and the pager under it. */
.ab-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
  align-items: start;
  margin: 1rem 0 1.5rem;
}

.ab-search,
.ab-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.8rem;
}

.ab-search input {
  flex: 1 1 16rem;
  max-width: 26rem;
}

.st-an-row a {
  position: relative;
  color: inherit;
}

/* Views of the build: totals, a bar per day, and where the views came from. */
.st-an-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.st-an-head h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

/* A small "i" that explains what it sits beside, on hover, keyboard focus or a tap. */
.st-hint {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0;
  color: var(--muted);
  cursor: help;
}

.st-hint:hover,
.st-hint:focus {
  color: var(--ember-hot);
  border-color: var(--ember-hot);
  outline: none;
}

.st-hint::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 0.5rem);
  left: -0.5rem;
  z-index: 5;
  width: max-content;
  max-width: min(19rem, 72vw);
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--step--1);
  font-style: normal;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.st-hint:hover::after,
.st-hint:focus::after {
  opacity: 1;
  visibility: visible;
}

.st-an-ranges {
  display: flex;
  gap: 0.3rem;
}

.st-an-ranges .st-button {
  padding: 0.2rem 0.55rem;
  font-size: var(--step--1);
}

.st-an-ranges [aria-pressed='true'] {
  border-color: var(--ember-hot);
  color: var(--ember-hot);
}

.st-an-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.8rem 0 0.6rem;
}

.st-an-totals > div {
  display: grid;
}

.st-an-number {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
}

.st-an-trend {
  font-size: var(--step--1);
  color: var(--muted);
  min-height: 1.2em;
}

.st-an-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 6rem;
  padding-top: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.st-an-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--ember-hot), var(--ember));
}

.st-an-bar.is-empty {
  background: var(--border);
}

.st-an-bar:hover {
  background: var(--yellow);
}

.st-an-axis {
  display: flex;
  justify-content: space-between;
  margin: 0.25rem 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.st-an-own {
  margin: 0.6rem 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.st-an-lists {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.st-an-lists h3 {
  margin: 0 0 0.25rem;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-an-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.15rem;
  padding: 0.15rem 0.4rem;
  font-size: var(--step--1);
}

.st-an-row i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: rgba(232, 89, 12, 0.18);
}

.st-an-row span {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* What was asked of the build, newest first. */
.st-history {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

/* Each kind of entry has its own colour: the build, a change, a failure, a cancelled one. */
.st-history-item {
  --tone: var(--good);
  --tone-soft: rgba(61, 214, 140, 0.08);
  padding: 0.65rem 0.75rem 0.7rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone);
  border-radius: var(--radius);
  background: var(--tone-soft);
}

.st-history-item--build {
  --tone: var(--ember-hot);
  --tone-soft: rgba(255, 122, 47, 0.1);
}

.st-history-item--remix {
  --tone: var(--yellow);
  --tone-soft: rgba(255, 225, 74, 0.08);
}

.st-history-item--failed {
  --tone: var(--bad);
  --tone-soft: rgba(255, 107, 107, 0.08);
}

.st-history-item--cancelled {
  --tone: var(--muted);
  --tone-soft: rgba(181, 163, 148, 0.07);
}

.st-history-item p {
  margin: 0;
}

.st-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.st-history-kind {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--tone);
}

.st-history-outcome {
  flex: none;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--tone);
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--tone);
}

/* Small, tight text: people skim these, and more of a request and its reply fits in view. */
.st-history-item blockquote {
  margin: 0.35rem 0 0.45rem;
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 10rem;
  overflow-y: auto;
}

.st-history-item--failed blockquote,
.st-history-item--cancelled blockquote {
  color: var(--muted);
}

/* What the builder said when it finished: why it made what it made. */
.st-history-reply {
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.st-history-reply-head {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-history-item .st-history-reply-text {
  margin-top: 0.15rem;
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 14rem;
  overflow-y: auto;
}

.st-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
  font-size: var(--step--1);
}

/* The model and what it cost, as small tags. */
.st-chip {
  display: inline-flex;
  align-items: baseline;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
}

.st-chip--model {
  color: #9fd4ff;
  border-color: rgba(159, 212, 255, 0.4);
  background: rgba(159, 212, 255, 0.08);
}

.st-chip--credits {
  color: var(--yellow);
  border-color: rgba(255, 225, 74, 0.45);
  background: rgba(255, 225, 74, 0.1);
  font-weight: 700;
}

.st-chip--refund {
  color: var(--muted);
}

.st-chip-unit {
  margin-left: 0.35em;
  font-weight: 400;
  opacity: 0.85;
}

.st-history-when {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin-left: auto;
  color: var(--muted);
}

.st-history-when strong {
  color: var(--text);
  font-weight: 700;
}

.st-files {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  display: grid;
  gap: 0.15rem;
}

.st-files li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.st-files li span:first-child {
  overflow-wrap: anywhere;
}

.st-card--danger {
  border-color: transparent;
  background: transparent;
  padding-inline: 0;
}

@media (max-width: 1000px) {
  .st {
    grid-template-columns: 1fr;
  }

  .st-rail {
    position: static;
    max-height: 16rem;
  }

  .st-split {
    grid-template-columns: 1fr;
  }

  .st-preview {
    height: 70vh;
  }
}

.st-enhance {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.st-enhance h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
}

.st-enhance p { margin: 0; }

.st-enhance fieldset {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.st-enhance legend {
  padding: 0 0.3rem;
  font-weight: 700;
}

.st-enhance label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
}

.st-enhance input[type="text"] {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.st-enhance-text {
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--good);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  line-height: 1.6;
  white-space: pre-wrap;
}

.st-enhance ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.st-options label { align-items: flex-start; }
.st-options label > span { display: grid; gap: 0.1rem; flex: 1; }
.st-options label small { color: var(--muted); font-size: var(--step--1); line-height: 1.4; }

.st-marks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-mark { display: inline-flex; align-items: center; gap: 0.3rem; }
.st-dots { display: inline-flex; gap: 0.16rem; }
.st-dots i { width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1px solid var(--muted); }
.st-dots[data-level="1"] i:nth-child(-n+1) { background: var(--good); border-color: var(--good); }
.st-dots[data-level="2"] i:nth-child(-n+2) { background: var(--yellow); border-color: var(--yellow); }
.st-dots[data-level="3"] i:nth-child(-n+3) { background: var(--bad); border-color: var(--bad); }
.st-legend { font-size: var(--step--1); color: var(--muted); }

.st-ideas {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.st-idea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: var(--bg-2);
  display: grid;
  gap: 0.4rem;
}

.st-idea h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  margin: 0;
}

.st-idea p {
  margin: 0;
  color: var(--muted);
}

.st-idea ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.st-card h3 {
  font-size: var(--step-0);
  margin: 1rem 0 0.2rem;
}

.st-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.st-pair input,
.st-conn-form input,
.st-conn-form select,
#st-ai-cap {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
}

#st-ai-cap {
  width: 7rem;
}

.st-conn-form {
  margin-top: 0.6rem;
  gap: 0.35rem;
}

.st-link {
  font: inherit;
  color: var(--bad);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.st-switches {
  border: 0;
  margin: 0.8rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.st-switches legend {
  padding: 0 0 0.3rem;
  font-size: var(--step--1);
}

.st-switches input {
  accent-color: var(--ember-hot);
}

/* Admin list of builds. */
.ab {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.ab h1 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  margin: 0.4rem 0;
}

.ab h2 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  margin: 1.6rem 0 0.6rem;
}

.ab-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.ab-table th,
.ab-table td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

.ab-table td:first-child {
  white-space: normal;
  min-width: 14rem;
}

.ab-table th {
  color: var(--muted);
  font-weight: 700;
  background: var(--surface);
}

.ab-actions {
  display: flex;
  gap: 0.4rem;
}

/* Share page: our bar on top, the build filling the rest. */
.sh-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.sh-bar {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-height: 3rem;
  padding: 0.4rem 0.75rem 0.4rem 0.9rem;
  background:
    radial-gradient(120% 220% at 0% 0%, rgba(232, 89, 12, 0.2), transparent 55%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  font-size: var(--step--1);
}

/* The ember line under the bar. */
.sh-bar::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ember-hot), var(--yellow) 28%, rgba(232, 89, 12, 0.35) 60%, transparent);
}

.sh-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}

.sh-brand-mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, var(--yellow), var(--ember-hot) 55%, var(--ember-deep));
  box-shadow: 0 0 12px rgba(255, 122, 47, 0.75);
}

.sh-brand:hover .sh-brand-mark {
  box-shadow: 0 0 18px rgba(255, 225, 74, 0.9);
}

.sh-title {
  min-width: 0;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-pill,
.sh-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(247, 241, 232, 0.04);
  white-space: nowrap;
  text-decoration: none;
  font: inherit;
  font-size: var(--step--1);
}

.sh-pill--private {
  color: var(--yellow);
  border-color: rgba(255, 225, 74, 0.4);
  background: rgba(255, 225, 74, 0.08);
}

.sh-pill--public,
.sh-chip--on {
  color: var(--good);
  border-color: rgba(61, 214, 140, 0.4);
  background: rgba(61, 214, 140, 0.08);
}

.sh-chip--button {
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
}

a.sh-chip:hover,
.sh-chip--button:hover {
  border-color: var(--ember-hot);
  color: var(--text);
}

.sh-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sh-spacer {
  flex: 1;
}

.sh-actions {
  display: flex;
  flex: none;
  gap: 0.35rem;
}

.sh-ico {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sh-ico--sm {
  width: 0.85rem;
  height: 0.85rem;
}

.sh-act {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(247, 241, 232, 0.04);
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.sh-act:hover,
.sh-act:focus-visible {
  transform: translateY(-1px);
  color: var(--ember-hot);
  border-color: var(--ember-hot);
  background: rgba(232, 89, 12, 0.14);
  box-shadow: 0 4px 14px rgba(232, 89, 12, 0.3);
  outline: none;
}

.sh-votes { display: inline-flex; gap: 0.35rem; }

.sh-vote {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.15rem;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(247, 241, 232, 0.04);
  box-shadow: none;
  font: inherit;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.sh-vote:hover,
.sh-vote:focus-visible { border-color: var(--ember-hot); color: var(--ember-hot); outline: none; }
.sh-vote[data-vote="1"][aria-pressed="true"] { color: var(--good); border-color: var(--good); background: rgba(81, 207, 102, 0.12); }
.sh-vote[data-vote="-1"][aria-pressed="true"] { color: var(--bad); border-color: var(--bad); background: rgba(255, 107, 107, 0.12); }
.sh-vote:disabled { opacity: 0.6; cursor: progress; }

.sh-act:disabled {
  opacity: 0.5;
  cursor: progress;
}

.sh-act--report {
  color: var(--bad);
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
}

.sh-act--report:hover,
.sh-act--report:focus-visible {
  color: #fff;
  border-color: var(--bad);
  background: var(--bad);
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.4);
}

/* What a control does, shown under it on hover or keyboard focus. */
.sh-tip {
  position: relative;
}

.sh-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 3;
  width: max-content;
  max-width: min(17rem, 80vw);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.sh-tip--start::after {
  right: auto;
  left: 0;
}

.sh-tip:hover::after,
.sh-tip:focus-visible::after {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .sh-bar {
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-left: 0.6rem;
  }

  /* The title gives way first, so the name and the actions stay on one row. */
  .sh-title {
    flex: 1 1 0;
    padding-left: 0.45rem;
  }

  .sh-pill,
  .sh-spacer {
    display: none;
  }

  /* The note about an app using your credits gets a row of its own. */
  .sh-ai,
  a.sh-chip {
    order: 5;
    flex: 1 1 100%;
    flex-wrap: wrap;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sh-act,
  .sh-tip::after {
    transition: none;
  }
}

.sh-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.sh-missing {
  max-width: 34rem;
  margin: 12vh auto;
  padding: 0 1.5rem;
}

.sh-missing h1 {
  font-family: var(--font-display);
  font-size: var(--step-2);
}
