/* Python runner widget — math.rpmhub.dev */

.python-runner {
  margin: 1.5rem 0;
  border: 1px solid #e6e1e8;
  border-radius: 6px;
  overflow: hidden;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
}

.runner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #f5f6fa;
  border-bottom: 1px solid #e6e1e8;
  font-size: 0.78rem;
  color: #5c5962;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.runner-label { flex: 1; }

.run-btn {
  background: #7253ed;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.run-btn:hover  { background: #5e41d0; }
.run-btn:active { background: #4f36b5; }
.run-btn:disabled { opacity: 0.5; cursor: wait; }

.code-input {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 1rem;
  margin: 0;
  background: #1e1e2e;
  color: #cdd6f4;
  border: none;
  resize: vertical;
  outline: none;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
  overflow-x: auto;
  box-sizing: border-box;
}

.code-output {
  display: none;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e6e1e8;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.78rem;
  color: #1a6a1a;
  white-space: pre-wrap;
  max-height: 450px;
  overflow-y: auto;
  background: #f6fff6;
  margin: 0;
}

.code-output.visible { display: block; }
.code-output.error   { color: #c62828; background: #fff6f6; }
.code-output img {
  max-width: 100%;
  margin-top: 0.5rem;
  border-radius: 4px;
  display: block;
}

/* Loading toast */
.py-loading {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #fff;
  border: 1px solid #7253ed;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-size: 0.78rem;
  color: #5c5962;
  z-index: 9999;
  display: none;
  box-shadow: 0 2px 12px rgba(114, 83, 237, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.py-loading.visible { display: block; }
