/* Halfpix v1.2.16 — Kiln Log editor workspace.
   Editing a firing shows only the form and a "Firing summary" in the Studio right column
   (where Piece journal shows its phone preview). Canonical --ui-* tokens only. */

/* Editor mode: the waiting list, firings list and toolbar step aside. */
.hp-main .kiln-page.is-editing > :is(.kiln-toolbar, .kiln-ready, .kiln-batches, .kiln-notice) {
  display: none;
}

.hp-main .kiln-workspace {
  display: grid;
  gap: 20px;
  align-items: start;
  margin: 0 0 28px;
}

/* pages.css caps .hp-form at 720px, which left an empty band beside the form. */
.hp-main .kiln-workspace > .kiln-editor {
  max-width: none;
  margin: 0;
}

.hp-main .kiln-editor__head {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.hp-main .kiln-editor__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: var(--ui-radius-pill);
  background: var(--ui-surface-soft);
  color: var(--ui-primary-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hp-main .kiln-editor__back:hover {
  background: var(--ui-primary-soft);
}

.hp-main .kiln-editor__back .app-icon {
  width: 18px;
  height: 18px;
}

/* ---------- Summary card ---------- */
.hp-main .kiln-summary__card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.hp-main .kiln-summary__eyebrow {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hp-main .kiln-summary__card h3 {
  margin: -8px 0 0;
  overflow-wrap: anywhere;
  font-size: 19px;
  line-height: 1.3;
}

.hp-main .kiln-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hp-main .kiln-summary__chips span {
  padding: 4px 10px;
  border-radius: var(--ui-radius-pill);
  background: var(--ui-primary-soft);
  color: var(--ui-primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.hp-main .kiln-summary__stage {
  display: grid;
  gap: 8px;
  color: var(--ui-muted);
  font-size: 13px;
}

.hp-main .kiln-summary__stage strong {
  color: var(--ui-ink);
}

.hp-main .kiln-summary__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0;
  padding: 14px 0;
  border-block: 1px solid var(--ui-line);
}

.hp-main .kiln-summary__facts div {
  min-width: 0;
}

.hp-main .kiln-summary__facts dt {
  color: var(--ui-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.hp-main .kiln-summary__facts dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-main .kiln-summary__pieces {
  display: grid;
  gap: 8px;
}

.hp-main .kiln-summary__pieces-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hp-main .kiln-summary__pieces-head strong {
  font-size: 15px;
}

.hp-main .kiln-summary__pieces-head small,
.hp-main .kiln-summary__pieces p,
.hp-main .kiln-summary__effect p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 13px;
}

.hp-main .kiln-summary__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hp-main :is(.kiln-summary__thumb, .kiln-summary__more) {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--ui-radius-xs);
  background: var(--ui-surface-soft);
  color: var(--ui-primary-strong);
  object-fit: cover;
}

.hp-main .kiln-summary__thumb .app-icon {
  width: 18px;
  height: 18px;
}

.hp-main .kiln-summary__more {
  font-size: 13px;
  font-weight: 700;
}

.hp-main .kiln-summary__effect {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-canvas);
}

.hp-main .kiln-summary__effect strong {
  font-size: 13px;
}

.hp-main .kiln-summary__effect ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--ui-ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.hp-main .kiln-summary__actions {
  display: grid;
  gap: 8px;
}

.hp-main .kiln-summary__actions .hp-button {
  width: 100%;
  justify-content: center;
}

.hp-main .kiln-summary__bar {
  display: none;
}

/* ---------- Desktop: two columns, sticky summary ---------- */
@media (min-width: 1024px) {
  .hp-main .kiln-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }
  .hp-main .kiln-summary {
    position: sticky;
    top: 92px;
  }
  /* Save / Finish live in the summary on desktop; Delete and Cancel stay in the form. */
  .hp-main .kiln-editor__actions .kiln-editor__primary {
    display: none;
  }
}

/* ---------- Tablet and phone: compact summary bar ---------- */
@media (max-width: 1023px) {
  .hp-main .kiln-summary__card {
    display: none;
  }
  .hp-main .kiln-summary {
    position: sticky;
    bottom: 12px;
    z-index: 20;
  }
  .hp-main .kiln-summary__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-pill);
    background: rgb(255 255 255 / .96);
    box-shadow: var(--ui-shadow-float);
    font-size: 13px;
  }
  .hp-main .kiln-summary__bar > span {
    min-width: 0;
    overflow: hidden;
    color: var(--ui-ink-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .hp-main .kiln-summary__bar .hp-button {
    flex: 0 0 auto;
    min-height: 42px;
    padding-inline: 20px;
  }
}

/* Phones: fixed above the bottom navigation (no left rail at this width). Fixed positioning
   does not depend on the scroll container, so it holds even where sticky is unsupported. */
@media (max-width: 850px) {
  .hp-main .kiln-summary {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 40;
  }
  .hp-main .kiln-page.is-editing .kiln-workspace {
    margin-bottom: 96px;
  }
}

/* feed-parity.css sets html, body { overflow-x: hidden }. On body that creates a scroll
   container, so every position: sticky descendant (this summary, the Create phone preview,
   product galleries) stops sticking. clip prevents horizontal overflow without that side effect. */
@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}
