/* Stem editor page. Shared panels, cards and fields come from studio.css. */
/* Reserve the shade editor's bottom Info slot so Settings stays in the same place. */
.editor-page[data-editor="stem"] .topbar .header-right::after {
  content: "";
  order: 10;
  flex: 0 0 44px;
  height: 44px;
}
.stem-split-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.stem-split-toggle input {
  flex: 0 0 auto;
}
.stem-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #516b83;
  background: #eef3f8;
  font-size: 12px;
  font-weight: 600;
}
.stem-status[data-level="ready"] {
  color: #1f6b45;
  background: #e4f4ea;
}
.stem-status[data-level="error"] {
  color: #9b2c2c;
  background: #fbeaea;
}
.stem-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: 2px;
  padding: 0 4px;
  border-radius: 8px;
  color: #fff;
  background: #c0392b;
  font-size: 10px;
  font-weight: 700;
}
.stem-count[hidden] {
  display: none;
}
.stem-card {
  overflow-y: auto;
}
.stem-card[hidden] {
  display: none;
}
.stem-card .button.block {
  margin-top: 8px;
}
.stem-card-heading,
.stem-tool-heading {
  margin: 18px 0 8px;
  color: #29415a;
  font-size: 13px;
  font-weight: 700;
}
.stem-issues,
.stem-parts,
.stem-notes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
ol.stem-notes {
  padding-left: 18px;
  list-style: decimal;
}
ul.stem-notes {
  padding-left: 15px;
  list-style: disc;
}
.stem-notes li {
  color: #516b83;
  font-size: 12px;
  line-height: 1.45;
}
.stem-issue {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-left: 3px solid #8aa0b8;
  border-radius: 6px;
  color: #40566d;
  background: #f4f7fa;
  font-size: 12px;
  line-height: 1.4;
}
.stem-issue strong {
  font-size: 11px;
}
.stem-issue-error {
  border-left-color: #c0392b;
  background: #fbeeee;
}
.stem-issue-error strong {
  color: #9b2c2c;
}
.stem-issue-warning {
  border-left-color: #d9962a;
  background: #fdf6e8;
}
.stem-issue-warning strong {
  color: #8a5a10;
}
.stem-part {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f7fa;
  font-size: 12px;
}
.stem-part strong {
  color: #29415a;
}
.stem-part span {
  color: #5f7790;
  font-variant-numeric: tabular-nums;
}
.stem-link {
  color: #2f6db5;
  font-size: 12px;
}
.stem-color {
  display: block;
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid #d5dee8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
body[data-editor="stem"].studio-light .tool-rail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body[data-editor="stem"].studio-light
  .settings-panel:not(.inspector-collapsed)
  .tools-collapse {
  top: 98px;
}
body[data-editor="stem"] .setting-group .select {
  margin-bottom: 14px;
}
body[data-editor="stem"] .setting-group > .button.block {
  margin: 4px 0 14px;
}
body[data-editor="stem"] .setting-group .field-hint {
  margin-bottom: 14px;
}
body[data-editor="stem"] .param[hidden],
body[data-editor="stem"] .button[hidden] {
  display: none;
}
.stem-view-toolbar {
  position: absolute;
  z-index: 3;
  left: calc(var(--preview-left, 0px) + var(--preview-width, 100%) / 2);
  bottom: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: calc(var(--preview-width, 100%) - 16px);
  width: max-content;
  padding: 6px 10px;
  transform: translateX(-50%);
  border: 1px solid #ffffffb0;
  border-radius: 14px;
  background: #ffffffd9;
  box-shadow: 0 6px 24px #2a3f5a1f;
  font-size: 12px;
}
.stem-view-modes {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: #e9eff6;
}
.stem-crown-hint {
  position: absolute;
  z-index: 3;
  left: calc(var(--preview-left, 0px) + var(--preview-width, 100%) / 2);
  top: 18px;
  width: min(360px, calc(var(--preview-width, 100%) - 32px));
  margin: 0;
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: #ffffffeb;
  color: #43566e;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}
.stem-crown-hint span + span {
  display: block;
  margin-top: 8px;
}
.stem-crown-hint [hidden] {
  display: none;
}
.stem-view-modes button,
.stem-view-reset {
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  color: #40566d;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.stem-view-modes button[aria-pressed="true"] {
  color: #1f3c5c;
  background: #fff;
  box-shadow: 0 1px 3px #2a3f5a2e;
}
.stem-view-reset:hover {
  background: #e9eff6;
}
.stem-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #40566d;
  font-weight: 600;
  cursor: pointer;
}
.stem-view-toggle:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}
.stem-view-modes button:focus-visible,
.stem-view-reset:focus-visible,
.stem-view-toggle input:focus-visible {
  outline: 2px solid #2f6db5;
  outline-offset: 2px;
}
body[data-editor="stem"] .fallback-label {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: calc(var(--preview-left, 0px) + var(--preview-width, 100%) / 2);
  transform: translateX(-50%);
}
@media (max-width: 760px) {
  .stem-view-toolbar {
    left: 50%;
    max-width: calc(100% - 16px);
    bottom: 8px;
  }
}

.stem-fix-now {
  justify-self: start;
  margin-top: 8px;
  min-height: 32px;
  padding: 5px 12px;
}

/* The stem's drawn outline, in the shade editor's profile colours. */
.profile-curve-editor {
  display: grid;
  gap: 8px;
  margin: 6px 0 14px;
}
.profile-curve {
  display: block;
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  background: var(--surface, #fafbfe);
  touch-action: none;
  user-select: none;
}
.profile-curve * {
  vector-effect: non-scaling-stroke;
}
.profile-curve-frame {
  fill: transparent;
  stroke: #8c9fb64d;
}
.profile-curve-body {
  fill: #b6d4f333;
  stroke: #829eb922;
}
.profile-curve-axis {
  stroke: #6c89aa77;
  stroke-width: 1.5;
  stroke-dasharray: 7 7;
}
.profile-curve-guide {
  stroke: #b0574477;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.profile-curve-table {
  stroke: #627086;
  stroke-width: 2;
}
.profile-curve-mirror {
  fill: none;
  stroke: #9bb4ce99;
  stroke-width: 2;
}
.profile-curve-line {
  fill: none;
  stroke: #41674c;
  stroke-width: 3;
}
.profile-curve-handle-line {
  stroke: #aa8260;
  stroke-width: 1.2;
}
.profile-curve-handle,
.profile-curve-point {
  cursor: grab;
  stroke: #fff;
  stroke-width: 1.5;
}
.profile-curve-handle {
  fill: #aa8260;
}
.profile-curve-point {
  fill: #41674c;
}
.profile-curve-point.active {
  fill: var(--gold, #1768cb);
}
.profile-curve-point:focus-visible {
  outline: none;
  stroke: var(--gold, #1768cb);
  stroke-width: 3;
}
.profile-curve-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-curve-status:empty {
  display: none;
}
.stem-split-controls,
.stem-print-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.stem-print-controls {
  margin-top: 14px;
}
