/* Spawn KuttyPy factory tool (Ctrl+Shift+K) */

body.view-spawn-active {
  overflow: hidden;
}

.app-view--spawn {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--header-height, 72px));
  min-height: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(251, 146, 60, 0.1), transparent 50%),
    var(--bg, #0b0f14);
}

.app-view--spawn[hidden] {
  display: none !important;
}

.spawn-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border, #334155);
  background: rgba(15, 23, 42, 0.92);
}

.spawn-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex: 1;
  min-width: 0;
}

.spawn-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.spawn-mcu-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #94a3b8;
}

.spawn-mcu-picker label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  color: #e2e8f0;
  font-weight: 600;
}

.spawn-mcu-picker input {
  margin: 0;
  accent-color: #38bdf8;
}

.spawn-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.spawn-section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem 5.5rem;
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
}

.spawn-section-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.spawn-section h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 750;
  line-height: 1.2;
  color: #f8fafc;
}

.spawn-section p {
  margin: 0;
  max-width: 52rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.spawn-section ul {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 52rem;
  color: #94a3b8;
  line-height: 1.55;
}

.spawn-section li + li {
  margin-top: 0.25rem;
}

.spawn-section-actions {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
}

.spawn-section-actions--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: calc(100% - 2.2rem);
}

.btn-spawn-action {
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0b1220;
  background: #38bdf8;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}

.btn-spawn-action:hover:not(:disabled) {
  background: #7dd3fc;
}

.btn-spawn-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-spawn-action--secondary {
  color: #e2e8f0;
  background: #334155;
  box-shadow: none;
}

.btn-spawn-action--secondary:hover:not(:disabled) {
  background: #475569;
}

.spawn-section-note {
  margin: 0;
  max-width: 52rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.spawn-section-note[data-kind="ok"] {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.35);
  border-color: rgba(74, 222, 128, 0.35);
}

.spawn-section-note[data-kind="err"] {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.35);
}

.spawn-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border, #334155);
  background: rgba(15, 23, 42, 0.92);
}

.spawn-status {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.spawn-status[data-kind="ok"] {
  color: #86efac;
}

.spawn-status[data-kind="err"] {
  color: #fca5a5;
}

.spawn-upload-progress .cide-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.spawn-upload-progress .cide-progress-text {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

@media (max-width: 700px) {
  .spawn-section {
    padding-bottom: 7.5rem;
  }

  .spawn-section-actions {
    left: 1.1rem;
    right: 1.1rem;
  }

  .spawn-section-actions--row {
    max-width: none;
    justify-content: stretch;
  }

  .spawn-section-actions--row .btn-spawn-action {
    flex: 1 1 100%;
  }

  .btn-spawn-action {
    width: 100%;
  }
}
