.sp-page { background: #fbf6f1; color: #3a2c26; }
.sp-app {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.sp-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-steps button {
  border: 1px solid #eadfd4;
  background: #fff;
  color: #6d564b;
  border-radius: 999px;
  padding: 7px 12px;
  font: 650 13px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.sp-steps button i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: #f3e6dc;
  font-style: normal;
  font-size: 11px;
}
.sp-steps button.is-on {
  border-color: #ff5c1f;
  color: #ff5c1f;
  box-shadow: inset 0 0 0 1px #ff5c1f;
}
.sp-work { display: flex; gap: 12px; min-height: 560px; align-items: stretch; }
.sp-view {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 80% at 50% 42%, #fff3e8 0%, #f8dcc8 46%, #f3c9ae 100%);
}
.sp-bar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  padding: 12px 12px 0;
  align-items: start;
}
.sp-presets { grid-column: 1 / -1; }
.sp-stage { position: relative; flex: 1 1 auto; min-height: 280px; }
.sp-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sp-tools, .sp-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-presets span { font-size: 12px; font-weight: 700; color: #6d564b; }
.sp-tools button, .sp-presets button, .sp-reset {
  border: 0;
  background: rgba(255, 252, 248, 0.94);
  color: #4a382f;
  border-radius: 999px;
  padding: 7px 11px;
  font: 650 12px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(80, 40, 20, 0.08);
}
.sp-tools button.is-on, .sp-presets button.is-on, .sp-types button.is-on, .sp-cut-tabs button.is-on {
  background: #ff5c1f;
  color: #fff;
}
.sp-reset { justify-self: end; }
.sp-drop {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  pointer-events: none;
}
.sp-drop[hidden] { display: none; }
.sp-drop p { margin: 0; font: 700 22px/1.2 "Space Grotesk", Inter, sans-serif; }
.sp-drop button { pointer-events: auto; }
.sp-drop span { color: #7c6156; font-size: 13px; }
.sp-drop button, .sp-go, .sp-actions button {
  border-radius: 12px;
  font: 700 14px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.sp-drop button {
  border: 0;
  background: #ff5c1f;
  color: #fff;
  padding: 10px 14px;
}
.sp-meta {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  margin: 0;
  white-space: pre-line;
  color: #5c463c;
  font-size: 12px;
  font-weight: 650;
}
.sp-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  background: #5e5854;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  max-width: calc(100% - 220px);
  text-align: center;
}
.sp-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sp-labels span {
  position: absolute;
  transform: translate(8px, -18px);
  background: #fff;
  color: #ff5c1f;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 4px 12px rgba(80, 40, 20, 0.12);
}
.sp-explode {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 252, 248, 0.94);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}
.sp-explode:has(input[hidden]) { display: none; }
.sp-panel {
  width: 320px;
  flex: 0 0 320px;
  min-height: 0;
  background: #fff;
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 10px 36px rgba(90, 50, 20, 0.06);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-panel h2 { margin: 0; font: 700 16px/1.2 "Space Grotesk", Inter, sans-serif; }
.sp-kicker {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a7064;
}
.sp-cut-tabs, .sp-types, .sp-names, .sp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-cut-tabs button, .sp-types button {
  border: 1px solid #eadfd4;
  background: #fff;
  color: #4a382f;
  border-radius: 12px;
  padding: 7px 8px;
  font: 650 12px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.sp-slider, .sp-field, .sp-switch { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: #4a382f; }
.sp-slider output { float: right; color: #ff5c1f; font-variant-numeric: tabular-nums; }
.sp-slider input[type="range"] { width: 100%; accent-color: #ff5c1f; }
.sp-field select, .sp-names input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #eadfd4;
  border-radius: 10px;
  padding: 8px 10px;
  font: 600 14px/1.2 Inter, system-ui, sans-serif;
  color: #3a2c26;
  background: #fff;
}
.sp-names input { width: calc(50% - 3px); }
.sp-switch { position: relative; grid-template-columns: 1fr auto auto; align-items: center; }
.sp-switch i {
  width: 36px;
  height: 22px;
  border-radius: 999px;
  background: #eadfd4;
  position: relative;
}
.sp-switch input { position: absolute; opacity: 0; }
.sp-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}
.sp-switch input:checked + i { background: #ff5c1f; }
.sp-switch input:checked + i::after { left: 16px; }
.sp-foot {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  background: #fff;
}
.sp-go {
  border: 0;
  background: #ff5c1f;
  color: #fff;
  padding: 12px 14px;
}
.sp-actions button {
  flex: 1 1 140px;
  border: 1px solid #ff5c1f;
  background: #fff;
  color: #ff5c1f;
  padding: 10px 8px;
}
.sp-status { margin: 0; color: #6d564b; font-size: 13px; font-weight: 600; min-height: 2.6em; }
.sp-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sp-how article {
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.sp-how b { font-size: 14px; }
.sp-how span { color: #6d564b; font-size: 13px; }

html.is-embed body.sp-page { padding: 0 !important; overflow: hidden; background: #fbf6f1 !important; }
html.is-embed .site-header { display: none !important; }
html.is-embed .shell { height: 100%; }
html.is-embed .sp-app { width: 100%; height: 100%; padding: 22px 8px 8px; box-sizing: border-box; }
html.is-embed .sp-how { display: none; }
html.is-embed .sp-work { flex: 1; min-height: 0; }
html.is-embed .sp-view,
html.is-embed .sp-panel,
html.is-embed .sp-stage { min-height: 0; }
html.is-embed .sp-panel { max-height: none; }

@media (max-width: 860px) {
  html.is-embed body.sp-page { overflow: auto !important; }
  html.is-embed .sp-app { height: auto !important; min-height: 100%; }
  html.is-embed .sp-work { flex: none; min-height: 0; }
  .sp-work { flex-direction: column; min-height: 0; }
  .sp-view { min-height: 420px; height: 68vh; }
  .sp-stage { min-height: 240px; }
  .sp-panel { width: auto; flex-basis: auto; overflow: visible; }
  .sp-hint { display: none; }
  .sp-how { grid-template-columns: 1fr; }
}
